If you've contributed via Kickstarter/PayPal/Humble at a level where you're entitled to private alpha test access or a Supporter badge please send Jon Shafer a private message with your email address.

Author Topic: [1.0.1.5] Crash when writing a pillaged structure with a dead pillager army  (Read 42 times)

I have a reproducible crash during the end of turn autosave. File is attached; just press "End Turn".

The error is

Code: [Select]
ERROR ID :     [ The given key '[DEAD] Army (x0)  ▎  i3409  ▎  19,23' was not present in the dictionary ]
The crash log is shown at the bottom; unfortunately the formatting cuts off the relevant names, so I edited the game with dnSpy to give me the unaltered stack trace. This shows the problem is at

Code: [Select]
AtTheGatesGame.ns_GameCode.ns_MapObjects.ns_Components.CCanBePillaged.SaveRefs (ElfTools.Serialize.Saver saver) [0x00018]
AFAICT from the disassembly, this means that the game is trying to save a ref to a dead unit that pillaged a structure, but can't find that unit in the saved objects dictionary (presumably because dead units don't get saved?). I can't tell how exactly the game ended up in that state.

Code: [Select]

---------------------------------------------------------------------------------


        Friday, 24 May 2019   @   16:53


        ERROR ID :     [ The given key '[DEAD] Army (x0)  ▎  i3409  ▎  19,23' was not present in the dictionary ]


---------------------------------------------------------------------------------



System . Collections . Generic     Dictionary`2[TKey,TValue]  .  get_Item            (   TKey key) [0x0001e]   )

<b6017b108c4148adad3826865cf5dd25>:0   .  <b6017b108c4148adad3826865cf5dd25>:0 (      )

ElfTools                                     Serialize  .  Saveable obj) [0x00019](      )

<e8e9637fe31d44f791ab9088c1a29286>:0   .  <e8e9637fe31d44f791ab9088c1a29286>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00018](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00032](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00010](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x0001d](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00025](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00017](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00032](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Serialize  .  Saver saver) [0x00033](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                                      IO  .  Stream outputStream) [0x0001e](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                     String name, System  .  String copyName) [0x0001b](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                                 ATGGAME  .  CreateAutosave      (   ) [0x0000c]   )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               ATGPlayer  .  NewTurn             (   ) [0x00331]   )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               WorldCore  .  CycleTurnToNextPlayer (   ) [0x00066]   )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Framework  .  GameTime gameTime) [0x00094](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Framework  .  GameTime gameTime) [0x00001](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Framework  .  GameTime gameTime) [0x0001e](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

ElfTools                                     Framework  .  GameTime gameTime) [0x0009c](      )

<e8e9637fe31d44f791ab9088c1a29286>:0   .  <e8e9637fe31d44f791ab9088c1a29286>:0 (      )

AtTheGatesGame                               Framework  .  GameTime gameTime) [0x00031](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                               Framework  .  GameTime gameTime) [0x00001](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

Microsoft . Xna . Framework                       Game  .  Tick                (   ) [0x0010c]   )

<bd725f68adfd488fae59f51b4812c265>:0   .  <bd725f68adfd488fae59f51b4812c265>:0 (      )

Microsoft . Xna . Framework . SDL2_FNAPlatform . RunLoop (Microsoft . Xna          Framework  .  Game game) [0x00800](      )

<bd725f68adfd488fae59f51b4812c265>:0   .  <bd725f68adfd488fae59f51b4812c265>:0 (      )

Microsoft . Xna . Framework                       Game  .  Run                 (   ) [0x00037]   )

<bd725f68adfd488fae59f51b4812c265>:0   .  <bd725f68adfd488fae59f51b4812c265>:0 (      )

AtTheGatesGame                           ProgramCommon  .  RunGame             (   ) [0x000eb]   )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )

AtTheGatesGame                          MainEx (System  .  String[] args) [0x000c2](      )

<050581a9571f461bb2af0aa3c8a1bb28>:0   .  <050581a9571f461bb2af0aa3c8a1bb28>:0 (      )