Skip to content

[TF2] Fix incorrect coloring on death animation when dying to friendly Cow Mangler#1872

Open
dilbertron2 wants to merge 7 commits intoValveSoftware:masterfrom
dilbertron2:cow-mangler-fix
Open

[TF2] Fix incorrect coloring on death animation when dying to friendly Cow Mangler#1872
dilbertron2 wants to merge 7 commits intoValveSoftware:masterfrom
dilbertron2:cow-mangler-fix

Conversation

@dilbertron2
Copy link
Copy Markdown

@dilbertron2 dilbertron2 commented Apr 2, 2026

Description

When a player dies to the Cow Mangler, their ragdoll enters a dissolving/fizzling animation using the color of the opposing team. This behavior also occurs even if the player is dying to friendly Cow Mangler shots. This is because the function uses the color of the player's opposing team without any further checks.

This PR creates a new variable called m_bIsSuicide m_bIsFriendlyFireOrSuicide and utilises the player_death GameEvent to determine whether or not the death was caused by friendly fire/suicide. This variable is then incorporated into the ragdoll dissolving function.

Video

2026-03-31.12-11-35_1.mp4

when player dies to Cow Mangler, check if it was a suicide and if it is then set fizzle color to own team
@dilbertron2
Copy link
Copy Markdown
Author

Unsure if I have over-engineered this PR or not, there may be a simpler way to check if the player has killed themselves that I am unaware of.

@Permik
Copy link
Copy Markdown

Permik commented Apr 3, 2026

How does this interact with the friendly fire option? Do teammates killed by friendly fire get fizzled with correct colour in this instance?

This seems like it should just be handled "correctly" by checking the associated team of the projectile.

@dilbertron2
Copy link
Copy Markdown
Author

How does this interact with the friendly fire option? Do teammates killed by friendly fire get fizzled with correct colour in this instance?

This seems like it should just be handled "correctly" by checking the associated team of the projectile.

Completely forgot that friendly fire is a thing! I'll look into it..

check victim/attacker teams instead of direct victim/attacker pointers
@dilbertron2 dilbertron2 changed the title [TF2] Fix incorrect coloring on death animation when dying to your own Cow Mangler [TF2] Fix incorrect coloring on death animation when dying to friendly Cow Mangler Apr 3, 2026
@FlaminSarge
Copy link
Copy Markdown
Contributor

FlaminSarge commented Apr 8, 2026

Might be better to call it m_bAttackerSameTeam or something similar, for brevity (since self is same-team too).

For the sake of mods that add more teams, it may even be better to just store the attacker's team number instead, so that mods can color the particles appropriately even if they're e.g. green team.

Storing the var on the player seems incorrect in general for this, however. Maybe a param on DissolveEntity instead?

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.

4 participants