Fix stealth kill animation playing on the wrong ped/player - #5282
Open
TheCrazy17 wants to merge 3 commits into
Open
Fix stealth kill animation playing on the wrong ped/player#5282TheCrazy17 wants to merge 3 commits into
TheCrazy17 wants to merge 3 commits into
Conversation
FileEX
requested changes
Aug 30, 2026
Checking at the original active task gate means no register needs preserving and the skip path lands with its registers as the original code expects, instead of after the victim's task was already allocated. Also defines CTaskSimpleStealthKillSAInterface instead of reading the target through a raw offset.
FileEX
requested changes
Aug 30, 2026
Derives from CTaskSimpleSAInterface there instead of declaring the vtable and parent by hand.
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.
Summary
CEventHandler::ComputeDamageResponse has a shortcut that puts a damaged ped straight into the stealth kill death when the entity that caused the damage currently runs a CTaskSimpleStealthKill, without checking who that task is actually for. A knife kill keeps the task active on the killer for the whole animation, so any other damage they cause during that window (a tear gas tick from a grenade thrown earlier, a stray bullet) makes a different nearby ped play the stealth kill death animation and freeze up as if they were the victim.
This adds a hook at that shortcut which compares the task's real target (CTaskSimpleStealthKill::m_target) against the ped being processed; only the actual victim takes the stealth death path, everyone else gets the normal damage response.
Whitout fix: https://streamable.com/mp3i0d
With fix: https://streamable.com/psaelf
Motivation
Fixes #2897.
Test plan
Checklist