Jump to content

Germs corrupting save file - GermExposureMonitor


pether
  • Branch: Live Branch Version: Windows Pending

In the database, DuplicantStatusItems contains two items related to germs: ExposedToGerms and ContactWithGerms, that are used by GermExposureMonitor.

Both have resolveStringCallback processing some information about the germ the dupe is exposed to. They fetch the germs from the database and get their names witchout checking if the database contains said germs. If it does not - the game will crash with null-exception.

Please note, the database will lack the germs only if they dissapeared after game reload. That may happen only for modded germs, as base game will never change the germs in it's database. It is hard for a mod to fix things that happen when it becomes disabled, but still - it is purly modded issue. Please consider it when assigning a priority to the issue.

 

In my germ-related mod I was able to work-around this issue, feel free to peek into the code and use it for game improvements as an inspiration or copy source:

DiseasesExpanded_Patches_ExposureMonitor adds additional check to affected DuplicantStatusItems. If the germ the dupe is exposed to does not exist, the mod will return "INVALID_STATUS_ITEM" string instead of trying to get the name of null-germ. Those invalid strings must be later removed


Steps to Reproduce

1. Expose duplicant to a modded germs so they got related status item

2. Save and exit

3. Disable the mod

4. Reload the game

  • Like 1



User Feedback


Hm... that's akward... I cannot reproduce my own issue... Not sure what happened between I observed it and now, or maybe I'm reproducing it wrong, but the game no longer crashes... Maybe it was fixed in the meantime, or maybe there is some race condition... 

I will let you know if I encounter it again, but until then, I don't have the save for you guys...

  • Thanks 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...