Skip to content

Fix repeated cumflation hediff creation on missing genitals - #56

Open
NovSugarMan wants to merge 1 commit into
vegapnk:mainfrom
NovSugarMan:fix/missing-genitals-cumflation
Open

Fix repeated cumflation hediff creation on missing genitals#56
NovSugarMan wants to merge 1 commit into
vegapnk:mainfrom
NovSugarMan:fix/missing-genitals-cumflation

Conversation

@NovSugarMan

Copy link
Copy Markdown

Summary

  • Query the existing cumflation hediff when evaluating the auto-deflate condition.
  • Avoid creating an empty hediff as a side effect of a recurring AI condition.
  • Prevent repeated attempts to attach the hediff to a missing genitals body part.

Rationale

ThinkNode_ConditionalCumflationSeverity.Satisfied only needs to determine whether an existing cumflation hediff exceeds AutoDeflateMinSeverity.

Calling GetOrCreateCumflationHediff creates a zero-severity hediff when none exists. If the pawn's genitals body part is missing, RimWorld rejects that hediff and the recurring think-tree evaluation retries the operation, repeatedly logging:

Tried to add health diff to missing part BodyPartRecord(Genitals parts.Count=0)

Using GetFirstHediffOfDef preserves the normal behavior: actual cumflation still creates the hediff through CumflatePawn, while the AI condition only reads it.

Testing

  • Built the RimWorld 1.6 project successfully.
  • Confirmed normal cumflation still creates the hediff.
  • Confirmed pawns with a missing genitals body part no longer trigger the recurring error.

This PR intentionally targets RimWorld 1.6 only because that is the version tested locally.

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