jtoppins/dct

static asset: complains about no deathgoal and prevents loading of state file

jtoppins opened this issue · 0 comments

For some reason a static asset somehow gets saved to the statefile without any death goals. We have seen this issue before and it prevents the reloading of the state until either the asset is removed from the state file or the state file is deleted. We should be able to do better than this, for starters not asserting. We should just be able to detect this and immediately set the asset to dead. This should trigger a cleanup of the asset. If not we will still get the error in the log, assuming people monitor logs... they should.

1:21:55 AM.494  ERROR  SCRIPTING  DCT|Theater: protected call - [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\assets\StaticAsset.lua"]:131: runtime error: StaticAsset must have a deathgoal: CP-Armed-Recce_2_CP73 Armed Recce (HMV Attack1) stack traceback: [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:365: in function <[string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:363> [C]: in function 'assert' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\assets\StaticAsset.lua"]:131: in function '_setup' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\assets\AssetBase.lua"]:223: in function 'unmarshal' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\assets\AssetManager.lua"]:286: in function 'unmarshal' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:183: in function 'loadOrGenerate' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:211: in function <[string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:207> (tail call): ? [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Command.lua"]:45: in function 'execute' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:344: in function '_exec' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:368: in function <[string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:367> [C]: in function 'xpcall' [string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:371: in function <[string "C:\Users\DCS server\Saved Games\DCS.openbeta_server\Mods\tech\DCT\lua\dct\Theater.lua"]:362>