Skip to content

Fix null work-priority cache for generated pawns - #4

Open
scarf005 wants to merge 1 commit into
1trickPwnyta:experimentalfrom
scarf005:fix/mech-work-priority-null
Open

Fix null work-priority cache for generated pawns#4
scarf005 wants to merge 1 commit into
1trickPwnyta:experimentalfrom
scarf005:fix/mech-work-priority-null

Conversation

@scarf005

@scarf005 scarf005 commented Jul 23, 2026

Copy link
Copy Markdown

What

fix Select Attached Mechanoid mod not working with defaults mod

Reproduction

  1. enable biotech DLC, defaults, and Select Attached Mechanoid mod
  2. install a mechlink and choose a starting mechanoid
  3. selected mechanoid fails to spawn with following error message
Exception running QuestNode_Root_MechanitorStartingMech: System.NullReferenceException
  at Defaults.WorkPriorities.CompatibilityPatch_Pawn.Postfix
  at Verse.Pawn.WorkTypeIsDisabled
  at RimWorld.Pawn_WorkSettings.EnableAndInitialize
  at SelectAttachedMechanoid.StartingMechSelection.RunSelectedStartingMechQuest

CompatibilityPatch_Pawn calls Contains on cachedDisabledWorkTypes, which can be null while a newly generated mechanoid initializes work settings

Fix

added null check. tested locally and was able to choose and spawn mechanoid again

@scarf005
scarf005 marked this pull request as draft July 23, 2026 09:36
@scarf005
scarf005 marked this pull request as ready for review July 23, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant