RimWorld

RimWorld

Reunion
Kyrun  [developer] 6 Feb, 2020 @ 5:30pm
Bug Fixed: Already joined pawns getting reinjected into event
Technical Explanation

The mod makes a list of all the Ally pawns in the World pool during load. This list keeps track of all the pawns that can be injected into the events.

What happened here was that this list is, in programming terms, what you call a static variable. Basically, it persists over multiple reloads, and only gets reset when you first start up RimWorld.

The Bug

Each time you reload a game without exiting RimWorld, the same pawns get added to this list! As you play and reload, this list will get longer due to adding the same pawns on each reload. When you rescue one of the pawns in that list, only one instance of that pawn is removed. Thus, you will get the same pawn again (because it is still in that list).

And what's even worse is due to some bad luck, some of these pawns get spawned, and then returned to the World pool for whatever reason, which I believe is causing all the other bugs where some pawns revert to their starting gear and faction. I am not 100% sure but am pretty confident that it is related.

The Fix

I simply cleared the list when a game is loaded. Literally a one line code change.

Existing Save Games

For existing saves with a "clone" pawn in the World pool, you can use debug to spawn them and then destroy them. Save your game then restart RimWorld. Hopefully, there are no more bugs after this!


Thank you all for your bug reports and feedback! Without them, it would've been hard to debug this!
Last edited by Kyrun; 6 Feb, 2020 @ 5:59pm