RCOM or 'Realistic' 'Combat' 'Overhaul' 'Mod' is a mod for S.T.A.L.K.E.R. - Call of Pripyat that aims to bring in a greater emphasis on realism. After years of no development, I have returned to release a new version of RCOM as an addom to "Call of Chernobyl"

Forum Thread
  Posts  
NPC Looting Crash (Games : S.T.A.L.K.E.R.: Call of Pripyat : Mods : RCOM : Forum : delite : NPC Looting Crash) Locked
Thread Options
Jul 23 2011 Anchor

Ran into a crash this morning due to the NPC looting script. Error report was as follows:

FATAL ERROR

[error]Expression : !m_error_code
[error]Function : raii_guard::~raii_guard
[error]File : D:\prog_repository\sources\trunk\xrServerEntities\script_storage.cpp
[error]Line : 748
[error]Description : ... pripyat\gamedata\scripts\xr_corpse_detection.script:337: bad argument #1 to 'random' (interval is empty)

stack trace:

0023:69737365 gameux.dll

Looked at the script and the line reads as:

elseif items_value > 0 and math.random(items_value) < 50 then

Since I'm not terribly familiar with the scripting language stalker uses, I first assumed that this was indicative that there was no short circuit logic. So I attempted to split this line into two nested if conditions. However, with that change, the crash still occurred.

Eventually, I ended up simply cutting the random function from the line so that it looks as such:
elseif items_value > 0 and items_value < 50 then

This change resolved the crash. I am unsure as to what items were involved or the state of the corpse's inventory.

Jul 24 2011 Anchor

Thanks for the crash report. I believe this is a GSC line, and its rarely something I altered unless I put "MacBradley" tags in the script.

Anyway, the crash is because math.random is trying to to items_value as a parameter (should be an int), but it doesn't get initialized properly (or at all ha). I don't have time to look the script up right now but I'll check this out when I have time.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.