Repository navigation
End an operation when the patient or surgeon changes character - #29
Conversation
The operation records the patient's character when it begins. A character switch or permakill now ends it, and the cure or failure penalty only lands on the character who was on the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to The change ends or fails a surgery when the patient or surgeon changes character, and it skips the cure and penalty when the patient's active character differs from the recorded one. No actionable merge-blocking risk was identified, and the PR reports 100 passing tests.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The operation now records both participants' characters. Configured completion commands name accounts, so they are skipped once either participant has switched character or been permakilled; the built-in failure penalty still lands on a patient who is unchanged. A confirmed permakill ends the operation on its own, which covers an account's last character where no other character takes over. The presence check also turns away a dead patient or one now playing another character. The quit listener runs before RPCharacters unloads the quitting player, so a quit still finds the same character. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A surgery's cure, penalty or configured command could land on whichever character the patient happened to be playing when the operation ended, so switching character mid-operation moved the result onto someone else.
The operation now records both the surgeon's and the patient's character when it starts. It ends as soon as RPCharacters reports a switch or a permakill for either of them, including the permakill of an account's last character, where no switch follows. A patient who switches or is permakilled fails the operation with no penalty and no command. A surgeon who switches or dies gives up the operation; no command runs, and the unchanged patient still takes the built-in penalty. The configured success and failure commands only run when neither character has changed. The presence check now treats a dead patient, or one playing a different character, as having left the table.
A patient who logs off still counts as unchanged and takes the penalty, so quitting is not a way out. Surgery's quit listener now runs before RPCharacters unloads the quitting player's characters; before, it would have read no character and skipped the penalty.
Tested with
mvn clean verifyon Java 21 (107 tests, 100% line coverage). Separate tests cover a switched patient, a switched surgeon, the cure on changed and unchanged patients, permakills, the presence check and quit listener order. Removing each guard makes its tests fail.Part of TF-Minecraft/RPCharacters#89. Docs: TF-Minecraft/Docs#151.
🤖 Generated with Claude Code