KongMD-Steam / QuestionableEthicsEnhanced

The source code of the Questionable Ethics Enhanced mod for RimWorld.
MIT License
12 stars 7 forks source link

Installing bionic arm on healthy arm won't drop arm after surgery #31

Closed KongMD-Steam closed 5 years ago

KongMD-Steam commented 5 years ago

Describe the bug This mod patches natural body parts in the game to drop after installing an artificial replacement. This will only happen if the body part is not damaged. The 'drop healthy limb after surgery' mechanic works for all organs except for arms.

Expected behavior After installing a Bionic Arm, the biological arm should be spawned if it was healthy on the patient.

To Reproduce Steps to reproduce the behavior:

  1. Debug in a bionic arm and debug 'Finish all research'
  2. Find a pawn with a completely healthy arm. No negative hediffs
  3. In patient's Health tab, queue up Install bionic arm on that arm
  4. Observe that the biological arm will not be spawned after surgery

Additional context This mechanic seems to work fine for legs, eyes, hearts...etc. It's only arms that are having an issue. The patch method for Arms is the same as other body parts, so it's not immediately obvious what the problem is.

Technical notes

MedicalRecipesUtility.IsCleanAndDroppable() might be returning false or the PatchOperation for Arm is failing. Debug logging might be needed.