Skip to content

Commit b55b91b

Browse files
committed
Refactor infc laser prediction
1 parent c9abb7f commit b55b91b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,18 @@ void CCharacter::FireWeapon()
537537
if(GameWorld()->m_WorldConfig.m_IsInfClass)
538538
{
539539
FireDelay = 800;
540+
int Bounces = GetTuning(m_TuneZone)->m_LaserBounceNum;
541+
bool Explosive = false;
540542
switch(GetPlayerClass())
541543
{
542544
case PLAYERCLASS_MERCENARY:
543545
FireDelay = 200;
546+
Bounces = 0;
544547
break;
545548
case PLAYERCLASS_SCIENTIST:
546549
LaserReach = LaserReach * 0.6f;
550+
Bounces = 0;
551+
Explosive = true;
547552
break;
548553
case PLAYERCLASS_BIOLOGIST:
549554
{
@@ -567,11 +572,8 @@ void CCharacter::FireWeapon()
567572
}
568573

569574
CLaser *pLaser = new CLaser(GameWorld(), m_Pos, Direction, LaserReach, GetCid(), WEAPON_LASER, CLaser::NoBounce);
570-
if(GetPlayerClass() == PLAYERCLASS_SCIENTIST)
571-
{
572-
pLaser->SetBouncing(0);
573-
pLaser->SetExplosive(true);
574-
}
575+
pLaser->SetBouncing(Bounces);
576+
pLaser->SetExplosive(Explosive);
575577
pLaser->EnableBounce();
576578
}
577579
else

0 commit comments

Comments
 (0)