Skip to content

[TF2] Fix Bombinomicon & tf_birthday spawning ragdoll effects incorrectly #1224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bradasparky
Copy link

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 input SetCustomModelOffset.
5. The head gib spawned from a decapitation doesn't respect the value given to the input SetCustomModelOffset.
5a. Note: First feign is using hurtme 1, second is hurting myself with DMG_BLAST using TakeDamage() 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 for m_bFeignDeath before creating gibs.
  • Added the bFeignDeath parameter to CreatePlayerGibs() to be used in preventing feign death gibs from being assigned to m_hFirstGib or m_hHeadGib.
  • Removed the obsolete parameter bool bCurrentPosition from the function CreateTFGibs() because checking for m_bGib from within the function is the only condition necessary to determine the correct spawn position.
  • Replaced all instances of the network var m_vecRagdollOrigin with the function GetRenderOrigin() where it was being used as the position to create gibs & particles. This was done to respect the value of the input SetCustomModelOffset, and to correctly spawn gibs & particles on feign death ragdolls. Given that death ragdolls are client-sided, it makes sense that the use of m_vecRagdollOrigin is replaced with GetRenderOrigin(). This way custom client-side ragdolls and gibs are spawned in their correct positions client-side. This was actually already done for ragdolls with m_vecRagdollOrigin being commented out, it just needed to be done for every other place where the var was used.
  • bool m_bBombinomicon was added to C_TFRagdoll to reduce the amount of calls to pPlayer->HasBombinomiconEffectOnDeath(). This is initialized once the ragdoll is created.
  • Replaced a call to the public function IsCloaked() within the private function CreateTFRagdoll() with the private member m_bCloaked.

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.

1 participant