Skip to content

Commit 0fef0d6

Browse files
committed
Fix robogrunt damage reduction
1 parent dcbcbea commit 0fef0d6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dlls/rgrunt.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class CRGrunt : public CHGrunt
5151

5252
void Killed( entvars_t *pevInflictor, entvars_t *pevAttacker, int iGib );
5353
void BecomeDead();
54+
int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
5455
void TraceAttack( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
5556

5657
float m_flSparkTime;
@@ -361,6 +362,15 @@ void CRGrunt::BecomeDead()
361362

362363
#define ROBOGRUNT_DAMAGE (DMG_ENERGYBEAM|DMG_CRUSH|DMG_MORTAR|DMG_BLAST|DMG_SHOCK|DMG_FREEZE|DMG_ACID)
363364

365+
int CRGrunt::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
366+
{
367+
if ((bitsDamageType & ROBOGRUNT_DAMAGE) == 0)
368+
{
369+
flDamage *= 0.2f;
370+
}
371+
return CHGrunt::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType );
372+
}
373+
364374
void CRGrunt::TraceAttack(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
365375
{
366376
if ((bitsDamageType & ROBOGRUNT_DAMAGE) == 0)
@@ -370,7 +380,6 @@ void CRGrunt::TraceAttack(entvars_t *pevInflictor, entvars_t *pevAttacker, float
370380
UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2 ) );
371381
pev->dmgtime = gpGlobals->time;
372382
}
373-
flDamage *= 0.2;
374383
}
375384
CSquadMonster::TraceAttack( pevInflictor, pevAttacker, flDamage, vecDir, ptr, bitsDamageType );
376385
}

0 commit comments

Comments
 (0)