Repository navigation
fix: pets take no damage from their owner - #45
Merged
Merged
Conversation
Pets following their owner were teleported next to them while an area skill was still active. Warrior Dash pulses every tick for 2.5 blocks and deals 10 damage, which kills a 10 HP cat outright, and the death deleted the pet. Damage is now cancelled at LOWEST when the responsible player is the pet's owner. That covers melee, the owner's projectiles and skill damage that names the owner as its causing entity. Other players and other owners' pets are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
Contributor
Author
|
Verified on TF Dev with this PR's CI artifact ( Setup:
Results:
Cleanup: the probe was removed and Dev restarted. Dev's 7 saved pets kept the same IDs, owners and types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A player reported their cats dying from "fall damage" after using Warrior Dash to drop down a slope. Vanilla cats are immune to fall damage, and CoreProtect attributes both deaths (TF Main, 2026-10-21 20:30:36/37) to the owner, Archbishqp.
The cats were following their owner. They teleported next to the owner on landing while
Warrior_Dashwas still pulsing@EIR{r=2.5}every tick for 10 damage. A cat has 10 HP, so each died outright, andlostBody()permanently deleted the pet.Change
PetListener.onOwnerDamagecancelsEntityDamageByEntityEventatLOWESTwhen the responsible player is the pet's owner account. The responsible player is the damage source's causing entity, falling back to the damager, then to a projectile's shooter. This covers:mmodamage) that names the caster as the causing entity, including any other area skill such as Warrior Lunge or Totem MineBecause the event is cancelled early, the pet loses no mood and plays no hurt animation. Damage from other players, and the owner's damage to other owners' pets, are unchanged.
Tests
PetListenerCoverageTest: 33/33 passing locally. With the handler disabled, the new owner-damage test fails.main(directory fsyncAccessDeniedException, cascading into "Already mocking"). CI on Linux is the authoritative run.🤖 Generated with Claude Code