[TF2] Fix incorrect coloring on death animation when dying to friendly Cow Mangler#1872
[TF2] Fix incorrect coloring on death animation when dying to friendly Cow Mangler#1872dilbertron2 wants to merge 7 commits intoValveSoftware:masterfrom
Conversation
when player dies to Cow Mangler, check if it was a suicide and if it is then set fizzle color to own team
|
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. |
|
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
|
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? |
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_bIsSuicidem_bIsFriendlyFireOrSuicideand utilises theplayer_deathGameEvent 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