Dubwise56 / Rimatomics

Nuclear power | Energy weapons | Nuclear weapons
41 stars 15 forks source link

UI error on map closure #20

Closed AerosAtar closed 3 years ago

AerosAtar commented 3 years ago

A spamming UI error is being thrown on the main colony map tile when a different map tile closes (event tile, camp tile from "Set-up Camp", etc). This seems to have started occuring since the latest update.

The main tile will render as plain black with only the pawn name overlay showing, as can be seen here (not my image): https://cdn.discordapp.com/attachments/214523406727512065/769359021835550741/unknown.png

The error in the log is as follows:

Root level exception in Update(): System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <567df3e0919241ba98db88bec4c6696f>:0 
  at Rimatomics.DubUtils.Rimatomics (Verse.Map map) [0x00024] in <40484af58eb44ed88a645447c6079d62>:0 
  at Rimatomics.Harmony_GridRegen.Prefix (Verse.Map __instance) [0x00000] in <40484af58eb44ed88a645447c6079d62>:0 
  at (wrapper dynamic-method) Verse.Map.Verse.Map.MapUpdate_Patch3(Verse.Map)
  at (wrapper dynamic-method) Verse.Game.Verse.Game.UpdatePlay_Patch2(Verse.Game)
  at Verse.Root_Play.Update () [0x00026] in <d72310b4d8f64d25aee502792b58549f>:0 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

A full log file can be found here (not my log, as mine won't upload due to being too large): https://gist.github.com/HugsLibRecordKeeper/6f39cb038ae86751c203eaf2747eada3

Steps to recreate:

  1. Run a caravan to a new map tile and enter the tile.
  2. Exit the tile so that it closes.
  3. Switch to your main colony tile.
  4. Watch as your screen goes dark and your log goes crazy.

Current Workaround: Save and Load the game. This clears the error and the game seems to run normally.

Multiple users are reporting this in the Rimworld Discord, and I am experiencing it myself too, so I thought it best to report it here.

Dubwise56 commented 3 years ago

ok pushed a fix, can you try it now

AerosAtar commented 3 years ago

That seems to have worked. Thanks for the quick turnaround!