ahuyn / anomaly-loot

Lootboxes for Anomaly
14 stars 5 forks source link

Crash and Inventory Generation Issue #3

Closed Nodens99 closed 2 years ago

Nodens99 commented 2 years ago

I fixed a vanilla bug with the game_relations.script by reversing the values in the initial function for the goodwill reset.

function reset_goodwill (faction_2 , faction_1) -- Reset the goodwill for actors of both factions if ui_options.get("alife/general/war_goodwill_reset") then if ( character_community( db.actor ) == faction1 or ("actor" .. faction_1) ) then relation_registry.set_community_goodwill( faction_2, AC_ID, 0 ) elseif ( character_community( db.actor ) == faction2 or ("actor" .. faction_2) ) then relation_registry.set_community_goodwill( faction_1, AC_ID, 0 ) end end end

After doing this I experienced this issue.

When first accessing trade with mechanics the lockpicks are 100% condition. After leaving the trade and coming back they switch to the lower value. If you kill the trader after allowing this to happen the game will crash.

! [LUA] SCRIPT RUNTIME ERROR ! [LUA] ...ker/anomaly-1.5.1\gamedata\scripts\pickset_binder.script:34: attempt to perform arithmetic on a nil value ! [SCRIPT ERROR]: ...ker/anomaly-1.5.1\gamedata\scripts\pickset_binder.script:34: attempt to perform arithmetic on a nil value

FATAL ERROR

[error]Expression : [error]Function : CScriptEngine::lua_error [error]File : ..\xrServerEntities\script_engine.cpp [error]Line : 191 [error]Description : fatal error [error]Arguments : LUA error: ...ker/anomaly-1.5.1\gamedata\scripts\pickset_binder.script:34: attempt to perform arithmetic on a nil value

stack trace:

ahuyn commented 2 years ago

Patched in latest. Not sure what the connection here is, but I added a nil check

Nodens99 commented 2 years ago

Right, I have no idea how it would interact with your script. Thanks though, I'll be testing it tonight.

Nodens99 commented 2 years ago

It is no longer Crashing! Although it still seems like you can buy lockpicks at 100% when first talking to a mechanic. I' m gonna go ahead and close this though.