ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.64k stars 615 forks source link

[TFC] Grenade Bug (Respawn Grenades Bug) #2343

Open se7entfc opened 5 years ago

se7entfc commented 5 years ago

This is 2 of 2 remaining bugs in TFC that really need attention.

Name: Grenade Bug (Respawn Grenades)

Explanation: This is another strange and rather inconsistent bug. The respawn grenade bug occurs when an unfortunate player has a grenade primed upon dying. When the respawn occurs, the grenade appears to travel with the player into the respawn and explodes causing damage to the player and his or her team mates. Seems to effect every type of grenade and is more frequent than the Death Bug.

I have no video clips of this bug yet.

Servers are currently using a 3rd party Metamod Plugin called Sparkys Utilities to fix this bug and an AMXX Plugin is also available.

Sparkys Utilities: http://web.archive.org/web/20050502130920/http://sparky.konspiracy.org/server/

AMXX Plugin: https://forums.alliedmods.net/showthread.php?t=297514

An official fix would make the game almost perfect.

SamVanheer commented 5 years ago

The game doesn't remove grenades that are primed when the player respawns. There is logic for throwing grenades from dead players so it should be fine to continue priming the grenade if they haven't respawned yet.

A check could be added to grenades where if the player has respawned after the grenade was primed but before a grenade has been thrown the grenade is simply removed instead.

The method CTFPrimeGrenade::GrenadePrimed already contains logic to do this, so a second condition needs to be added:

//Don't remove grenades spawned the same frame as when the player respawned?
if ( pPlayer->bRemoveGrenade || m_flPrimeTime < pPlayer->m_flLastRespawnTime )
{
  if( pPlayer->bRemoveGrenade )
  {
    pPlayer->tfstate &= 0xFFFFFBFE;
    pPlayer->bRemoveGrenade = 0;
  }
  dremove(this);
  return;
}

The new variables need to be added of course.

se7entfc commented 4 years ago

Just had some more information passed regarding this bug by the guys that made the TFC Fixes Plugin:

[09:50] azul`: it's a question of respawning too quickly after priming a grenade... there's a window in which the grenade entity thinks before it actually exists as a proper ctf grenade entity if you respawn before it does the 2nd think and assigns itself as the proper grenade the origin doesn't set, so it ends up setting on the priming player.

ChaosSpoofer commented 4 years ago

@mikela-valve

It sounds like there could be a couple easy ways to fix this problem. And it is indeed an obnoxious bug for those that routinely experience it (as I do), and which even casual players continue to express great annoyance over.

2493

Also remains an important grenade-related issue that severely impacts most players' abilities to accurately time their conc/grenade jumps depending on server lag, especially casual/vanilla players who don't take the time to implement some of the more complex workarounds (which still have their own significant drawbacks).