RAX-Anomaly / MagsRedux

Rework of Wuuts Mags
52 stars 21 forks source link

Game crashing in function 'CloneWep' #312

Closed BrokenParity closed 5 months ago

BrokenParity commented 6 months ago

hi, since 'MagsRedux' upgrade from '2023.08.04' to '2024.02.21' my game is crashing at specific times. I can relate those crashes to events when NPC is looting corpse. It has got me a while to figure out, it has been caused by MagsRedux but now i'm pretty sure it is. If another AddOn is direct involved - probably (i see 'BaS' mentioned in stack trace). I use 'ModdedExes 2024.02.05' .

I have isolated one Game Save where i'm sure it happens and have tested it few hours. It is not a new game but since MagsRedux have been in the game i don't know if this is of importance.

It always crashes with this trace:

!ERROR SYS_GetParam(0, nil, parent_section, nil) | What's missing?
~ ------------------------------------------------------------------------
~ STACK TRACEBACK:

        c:/ano/bin/..\gamedata\scripts\aaaa_script_fixes_mp.script (line: 176) in function 'SYS_GetParam'
        c:/ano/bin/..\gamedata\scripts\mags_patches.script (line: 334) in function 'CloneWep'
        c:/ano/bin/..\gamedata\scripts\zzz_bas_laser_control.script (line: 18) in function 'alife_clone_weapon'
        c:/ano/bin/..\gamedata\scripts\xr_gather_items.script (line: 190) in function 'f'
        c:/ano/bin/..\gamedata\scripts\state_mgr_animation.script (line: 518) in function 'process_special_action'
        c:/ano/bin/..\gamedata\scripts\state_mgr_animation.script (line: 275) in function 'select_anim'
        c:/ano/bin/..\gamedata\scripts\state_mgr_animation.script (line: 133) in function 'update_anim'
        c:/ano/bin/..\gamedata\scripts\state_mgr_animation.script (line: 394) in function <c:/ano/bin/..\gamedata\scripts\state_mgr_animation.script:373>
~ ------------------------------------------------------------------------
! [SCRIPT ERROR]: c:/ano/bin/..\gamedata\scripts\itms_manager.script:1243: attempt to index local 'owner' (a number value)

FATAL ERROR

[error]Expression    : <no expression>
[error]Function      : CScriptEngine::lua_pcall_failed
[error]File          : D:\a\xray-monolith\xray-monolith\src\xrServerEntities\script_engine.cpp
[error]Line          : 262
[error]Description   : fatal error
[error]Arguments     : 
 1 : [Lua] c:/ano/bin/..\gamedata\scripts\itms_manager.script(1243) : alife_create_item

LUA error: c:/ano/bin/..\gamedata\scripts\itms_manager.script:1243: attempt to index local 'owner' (a number value)

Check log for details

stack trace:

SymInit: Symbol-SearchPath: '.;Z:\;C:\ano\bin;C:\windows;C:\windows\system32;', symOptions: 530, UserName: 'foo'
OS-Version: 6.2.9200 () 0x0-0x1
C:\ano\bin\AnomalyDX11.exe:AnomalyDX11.exe (0000000140000000), size: 18128896 (result: 0), SymType: '-exported-', PDB: 'C:\ano\bin\AnomalyDX11.exe'

When i downgrade back to 2023.08.04 and start the Save again it doesn't happen.

The offending commit i have bisected so far is the https://github.com/RAX-Anomaly/MagsRedux/commit/4b3543d8c21020eae7a9e121c6f843bc755c5672 , and that is the part of it starting at:

    CloneWep = _G.alife_clone_weapon
    ...
    end

Just replacing the CloneWep function with that from Release 2023.08.04 is enough to not crash.

nn1123 commented 6 months ago

Где я могу найти релиз 2023.08.04?

Noirbreaker commented 5 months ago

I am also having the same issue. I originally thought it was New Levels V0.52 due to the itms_manager.script causing a CTD. Looking for an earlier release to compare the CloneWep function.

edit: I made two changes in mags_patches.script and have not had any crashes yet

mags_patches script change

mags_patches script change 2

ravenascendant commented 5 months ago

I pushed some fixes. please update and open a new issue for problems in the new version. thank you.