Skip to content

Commit 422b04c

Browse files
committed
Prediction: Disable grenade projectiles for Medic and Scientist
1 parent c2d3157 commit 422b04c

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/game/client/prediction/entities/character.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ void CCharacter::FireWeapon()
495495
case WEAPON_GRENADE:
496496
{
497497
int Lifetime = (int)(GameWorld()->GameTickSpeed() * GetTuning(GetOverriddenTuneZone())->m_GrenadeLifetime);
498-
498+
bool CreateProjectile = true;
499499
bool Explosive = true;
500500
if(GameWorld()->m_WorldConfig.m_IsInfClass)
501501
{
@@ -506,8 +506,12 @@ void CCharacter::FireWeapon()
506506
FireDelay = 250;
507507
break;
508508
case PLAYERCLASS_MEDIC:
509-
case PLAYERCLASS_NINJA:
510509
case PLAYERCLASS_SCIENTIST:
510+
CreateProjectile = false;
511+
Explosive = false;
512+
FireDelay = 500;
513+
break;
514+
case PLAYERCLASS_NINJA:
511515
Explosive = false;
512516
FireDelay = 500;
513517
break;
@@ -516,17 +520,20 @@ void CCharacter::FireWeapon()
516520
}
517521
}
518522

519-
new CProjectile(
520-
GameWorld(),
521-
WEAPON_GRENADE, //Type
522-
GetCid(), //Owner
523-
ProjStartPos, //Pos
524-
Direction, //Dir
525-
Lifetime, //Span
526-
false, //Freeze
527-
Explosive, // Explosive
528-
SOUND_GRENADE_EXPLODE //SoundImpact
529-
); //SoundImpact
523+
if(CreateProjectile)
524+
{
525+
new CProjectile(
526+
GameWorld(),
527+
WEAPON_GRENADE, // Type
528+
GetCid(), // Owner
529+
ProjStartPos, // Pos
530+
Direction, // Dir
531+
Lifetime, // Span
532+
false, // Freeze
533+
Explosive, // Explosive
534+
SOUND_GRENADE_EXPLODE // SoundImpact
535+
);
536+
}
530537
}
531538
break;
532539

0 commit comments

Comments
 (0)