I left a comment on the workshop page for the mod a couple days ago about a bug where the time to elections (and as it turns out the time to a decision cancelling) went negative and the election never happened. I have no experience with Rimworld modding but out of curiosity I decided to have a poke around based on this error log:
I haven't tested this solution fully (although I will play with it on my save going forward) so I'm not sure if it breaks anything else or if there's any other reason why this would be a dumb idea. If nothing else, however, this PR documents the bug a bit better than a Steam workshop comment, so I hope it's helpful :)
Hi,
I left a comment on the workshop page for the mod a couple days ago about a bug where the time to elections (and as it turns out the time to a decision cancelling) went negative and the election never happened. I have no experience with Rimworld modding but out of curiosity I decided to have a poke around based on this error log:
So it seems the offending error was being thrown in this enumeration: https://github.com/GarwelGarwel/Rimocracy/blob/cbc2d1c843d813263c4126cb9c9fbf4b6769bd04/Source/Defs/DecisionDef.cs#L204 which boils down to a
Where
here: https://github.com/GarwelGarwel/Rimocracy/blob/cbc2d1c843d813263c4126cb9c9fbf4b6769bd04/Source/Utility.cs#L68 I have no idea why thePawnsFinder
list was modified after the first iteration (note in the log Cass has her support recalculated and then it errors on the next iteration) to get that Linq error but just adding a.ToList()
on theCitizens
iterable prevents it erroring because of a change in thePawnsFinder
list. This allowed the decision to cancel and the election to fire successfully on my save.I haven't tested this solution fully (although I will play with it on my save going forward) so I'm not sure if it breaks anything else or if there's any other reason why this would be a dumb idea. If nothing else, however, this PR documents the bug a bit better than a Steam workshop comment, so I hope it's helpful :)