Flaregun: Don't burn boss enemies that require an RPG to take down. Only burn NPCs and ignitable props.

This commit is contained in:
Derek Dik 2018-11-08 16:56:00 -05:00
parent 83dfddfb13
commit 7ffe672afc

View File

@ -339,9 +339,9 @@ void CFlareGunProjectile::FlareGunProjectileBurnTouch(CBaseEntity *pOther)
{ {
if (pOther && pOther->m_takedamage && (m_flNextDamage < gpGlobals->curtime)) if (pOther && pOther->m_takedamage && (m_flNextDamage < gpGlobals->curtime))
{ {
IgniteOtherIfAllowed(pOther);
pOther->TakeDamage(CTakeDamageInfo(this, m_pOwner, 1, (DMG_BULLET | DMG_BURN))); pOther->TakeDamage(CTakeDamageInfo(this, m_pOwner, 1, (DMG_BULLET | DMG_BURN)));
m_flNextDamage = gpGlobals->curtime + 1.0f; m_flNextDamage = gpGlobals->curtime + 1.0f;
IgniteOtherIfAllowed(pOther);
} }
} }
@ -351,15 +351,28 @@ void CFlareGunProjectile::IgniteOtherIfAllowed(CBaseEntity * pOther)
if (pOther->IsPlayer()) if (pOther->IsPlayer())
return; return;
// Don't burn friendly NPCs
CAI_BaseNPC *pNPC; CAI_BaseNPC *pNPC;
pNPC = dynamic_cast<CAI_BaseNPC*>(pOther); pNPC = dynamic_cast<CAI_BaseNPC*>(pOther);
if (pNPC && pNPC->IsPlayerAlly()) if (pNPC) {
return; // Don't burn friendly NPCs
if (pNPC->IsPlayerAlly())
return;
// If this is an ignitable entity that isn't the player or an ally, ignite it! // Don't burn boss enemies
CBaseAnimating *pAnim; if (FStrEq(STRING(pNPC->m_iClassname), "npc_combinegunship")
pAnim = dynamic_cast<CBaseAnimating*>(pOther); || FStrEq(STRING(pNPC->m_iClassname), "npc_combinedropship")
if (pAnim) || FStrEq(STRING(pNPC->m_iClassname), "npc_strider")
pAnim->IgniteLifetime(30.0f); || FStrEq(STRING(pNPC->m_iClassname), "npc_helicopter")
)
return;
// Burn this NPC
pNPC->IgniteLifetime(30.0f);
}
// If this is a breakable prop, ignite it!
CBreakableProp *pBreakable;
pBreakable = dynamic_cast<CBreakableProp*>(pOther);
if (pBreakable)
pBreakable->IgniteLifetime(30.0f);
} }