bbradson / Performance-Fish

Performance Mod for RimWorld
Mozilla Public License 2.0
423 stars 34 forks source link

Try to fix game hang caused by shelf linking. #53

Closed Foxtr0t1337 closed 2 weeks ago

Foxtr0t1337 commented 2 weeks ago

Fixing an infinite loop caused by unchecked cache invalidation.

Sometime when you link shelves, a storageGroup in cache will not null, but with no SpawnedMember.

If unchecked, it will cause groupsOfPriorityCount to decrease by -1, which is a infinite loop.

This fix will FixCache when a group have no member.

47 #44

bbradson commented 2 weeks ago

Looks good. Thanks! SpawnedMemberCount is tracked by Fish there, and off because of groups having members assigned from more than one method, even outside of their class, with Fish simply not having every place patched. The FixCache path like used here triggers a recalculation when required