Skip to content

Fix #41: Prevent modded implants from crashing raids#53

Open
feldoh wants to merge 1 commit into
mainfrom
fix/41-implant-crash
Open

Fix #41: Prevent modded implants from crashing raids#53
feldoh wants to merge 1 commit into
mainfrom
fix/41-implant-crash

Conversation

@feldoh
Copy link
Copy Markdown
Owner

@feldoh feldoh commented Apr 12, 2026

Summary

  • Adds body part validation before applying hediffs that are Hediff_Implant subclasses — skips with a warning when no valid body part is found instead of passing null to MakeHediff
  • Wraps all hediff application in try/catch so a single bad hediff cannot crash the entire pawn generation postfix
  • Logs warnings via ModCore.Warn so users can identify which implant/mod is failing

Test plan

  • Force a hediff (e.g. a cybernetic implant) that requires a body part the pawn doesn't have
  • Verify the log shows a warning instead of crashing the raid
  • Verify other hediffs in the same list still apply correctly

Closes #41

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Skip implant hediffs when no valid body part is found instead of passing
null to MakeHediff, which caused Hediff_Implant.PostAdd to crash. Also
wrap hediff application in try/catch to prevent any single hediff failure
from aborting the entire pawn generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Issue with modded implants

1 participant