EntombedItemManager saves information about burried items in several lists. One of those lists is:
private List<byte> diseaseIndices = new List<byte>();
The list contains byte index of germs infesting each entombed item. Those values are serialized to save info between games. If after next game load the index of a germ changes, the manager is not aware of it and will use old value. As a result, burried items may change their germs or - if the index exceedes germ count in the database - the game crashes.
Please note, germs changing their idx currently may happen only when using (and eg disabling) germ-related mods and will never happen in vanilla games. 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_EntombedItems saves current germ idx for each game save and allows to translate them after next game reload if the idx of a germ changes. However, I feel it would be more efficient if EntombedItemManager saved ID of a germ instead it's idx in the list, as the ID will not change even if the germ gets disabled (I couldn't do that, I had to work with current structures in my mod, but I feel you guys could)
DiseasesExpanded_Patches_PrimaryElement adds additional check for germ-adding method of primary element - if the germ idx is not found in the db, addition does not happen. This does not prevent changing idx between games, but is good safety net to prevent crashes when something would try to add non-existing germ
1. Spawn item covered in modded germs
2. Entomb it in a tile of sand/snow
3. Save the game, disable germ mod
4. Reload the game. It may crash now, if the germ idx is bigger than total germ count in the db.
5. Dig the item - it will be covered with different germs now
- 1
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 accountSign in
Already have an account? Sign in here.
Sign In Now