RimWorld

RimWorld

Better GC: Mothballed and World Pawns
[BUG] This mod causes a NullReference bug while cleaning a pawn, leading to game lag.
I didn’t see any bug-report instructions in the description, so I’m posting it here.

The error log:
Originally posted by player.log:

Exception ticking ammy (at (137, 0, 78)): System.NullReferenceException: Object reference not set to an instance of an object
at RimWorld.Thought_Banished.get_ShouldDiscard ()

This error occurs repeatedly on multiple characters and triggering once per tick and causing the game to lag.

The error originates from RimWorld.Thought_Banished.get_ShouldDiscard(), a method in the Memory Thought system that determines whether a "banished" thought should be removed. It's a NullReferenceException, indicating the code tried to access a character that is null.

Ultimately, the null error is caused by this mod purging the banished pawn before the colonists’ “colonizer banished” thought times out, leaving the thought trying to reference a now-null pawn.

So I think the fix should be to add a check: don’t purge the corresponding pawn until its “banished” thought has actually expired.

For players hit by this bug:
The solution is to use the character editor to delete the "banished" thought from each character.