Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix static caches in Vanilla Expanded Framework (#449)
VEF has a static cache that handles additional pawn data, like pawn body size offset, multiplier to their health or the amount of food they eat. As it often happens with such caches, they aren't cleared when reloading a game/starting a new game. I've included cache clearing when loading a game/starting a new game. Another issue is that the data is re-cached (by default) every 180 ticks (which is fine), or every 2 seconds (which will cause issues in MP). I've added a patch to only re-cache the data only using the game ticks, rather than real time. On top of that, if the tick re-caching is disabled it will show a warning and enable it, before disabling real time re-caching (to prevent issues with never re-caching). The final issue with those is that the caches can be created or re-calculated both during ticking and interface code. I've added a patch that will only allow re-caching during ticking, so in interface code it'll never re-cache and never add the newly created data to the dictionary. Sadly, the solution here isn't the best I could have done due to `DictCache` being a generic type, making me unable to safely patch it. The last 2 points could have been more easily be done by making a prefix to `DictCache.GetCache` and changing all the bool input arguments to `false`.
- Loading branch information