[TF2] Fix Bombinomicon & tf_birthday
spawning ragdoll effects incorrectly
#1224
+56
−42
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.
Description
This PR fixes many bugs with the creation of ragdoll gibs & particles. The addition of the
tf_birthday
, the Bombinomicon, and Spy's weapons, the Dead Ringer and Your Eternal Reward, interact with each other in a way that that creates problematic gameplay scenarios for a stealthy Spy using either weapon. These bugs affect all ragdolls no matter the class, but are mainly a problem with Spy. Many fixes in this PR are also likely to fix more bugs than shown below.Note: All bugs mentioned below where the bombinomicon is featured also affects client-sided birthday gibs & gibs with low violence settings turned on.
Bugged Ragdoll Interactions
The videos below shows 3 clips in this order:
1.
When Spy uses the Dead Ringer, the explosion from his ragdoll causes gibs and particles to spawn at his current position instead of where his feign death ragdoll is. He also isn't able to gib after his feign death ragdoll gibs.2.
If you explode before your feign death ragdoll does, anyone spectating you will have their camera teleported to your feign death ragdoll's gibbed head, spawned at your actual death position, rather than following your actual gibbed head.3.
If your previous death produced a non-gibbed ragdoll and then you equip the bombinomicon, upon respawning/resupplying your ragdoll will explode. Note that I do not have the bombinomicon on my Spy while taunting before death, it's equipped once I respawn.Bugged
bugged-bombinomicon-gibs.mp4
Fixed
fixed-bombinomicon-gibs.mp4
The video below shows 2 clips in this order:
4.
Ragdoll gibs and particles don't respect the value given to the inputSetCustomModelOffset
.5.
The head gib spawned from a decapitation doesn't respect the value given to the inputSetCustomModelOffset
.5a.
Note: First feign is usinghurtme 1
, second is hurting myself withDMG_BLAST
usingTakeDamage()
from vscript.Bugged
bugged-custom-model-offset-gibs.mp4
Fixed
fixed-custom-model-offset-gibs.mp4
Your Eternal Reward
I've added a check to prevent cloaked ragdolls from exploding by the bombinomicon to prevent victims of the Your Eternal Reward from giving the Spy away. Although people have differing opinions about whether special ragdolls as a whole should be exempt from the bombinomicon explosion, I believe cloaked ragdolls to be the only one which has a negative effect on gameplay. The "silent killer" attribute isn't so silent or inconspicuous when your victim explodes into gibs and particles 1.2 seconds later. I'm aware that most cosmetics don't properly cloak which can give the Spy away, and that an ammo box will drop too, but those are separate issues, and I think we can all agree that a gib and particle explosion is more likely to give away the Spy's disguise.
The first clip is current, second clip is the proposed change
bombinomicon-cloaked-ragdoll-demo.mp4
Code Changes
m_hFirstGib
will no longer be assigned to feign death ragdoll gibs, removing the need to check form_bFeignDeath
before creating gibs.bFeignDeath
parameter toCreatePlayerGibs()
to be used in preventing feign death gibs from being assigned tom_hFirstGib
orm_hHeadGib
.bool bCurrentPosition
from the functionCreateTFGibs()
because checking form_bGib
from within the function is the only condition necessary to determine the correct spawn position.m_vecRagdollOrigin
with the functionGetRenderOrigin()
where it was being used as the position to create gibs & particles. This was done to respect the value of the inputSetCustomModelOffset
, and to correctly spawn gibs & particles on feign death ragdolls. Given that death ragdolls are client-sided, it makes sense that the use ofm_vecRagdollOrigin
is replaced withGetRenderOrigin()
. This way custom client-side ragdolls and gibs are spawned in their correct positions client-side. This was actually already done for ragdolls withm_vecRagdollOrigin
being commented out, it just needed to be done for every other place where the var was used.bool m_bBombinomicon
was added toC_TFRagdoll
to reduce the amount of calls topPlayer->HasBombinomiconEffectOnDeath()
. This is initialized once the ragdoll is created.IsCloaked()
within the private functionCreateTFRagdoll()
with the private memberm_bCloaked
.