From e290bc3fe0d74b2c7f36a8af6fd3cabbe6893e05 Mon Sep 17 00:00:00 2001 From: ModdedMarionette Date: Thu, 7 Nov 2024 17:24:11 -0500 Subject: [PATCH 1/2] Afterburn from Flamer should be considered Friendly Fire as well --- src/game/server/swarm/asw_marine.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/server/swarm/asw_marine.cpp b/src/game/server/swarm/asw_marine.cpp index 5f2038a76..beb2fa151 100644 --- a/src/game/server/swarm/asw_marine.cpp +++ b/src/game/server/swarm/asw_marine.cpp @@ -1434,7 +1434,8 @@ int CASW_Marine::OnTakeDamage_Alive( const CTakeDamageInfo &info ) // drop the damage down by our absorption buffer bool bFlamerDot = !!(newInfo.GetDamageType() & DMG_DIRECT); - if ( newInfo.GetDamage() > 0 && pAttacker != this && !bFlamerDot ) + bool bIsFlamer = newInfo.GetWeapon() && newInfo.GetWeapon()->Classify() == CLASS_ASW_FLAMER; + if ( newInfo.GetDamage() > 0 && pAttacker != this && (!bFlamerDot || bIsFlamer) ) { if ( asw_marine_ff_absorption.GetInt() != 0 ) { @@ -1447,7 +1448,7 @@ int CASW_Marine::OnTakeDamage_Alive( const CTakeDamageInfo &info ) } } // if 0 don't chatter about friendly fire - if ( rd_chatter_about_ff.GetBool() ) + if ( rd_chatter_about_ff.GetBool() && !bFlamerDot ) GetMarineSpeech()->QueueChatter( CHATTER_FRIENDLY_FIRE, gpGlobals->curtime + 0.4f, gpGlobals->curtime + 1.0f ); m_fLastFriendlyFireTime = gpGlobals->curtime; @@ -1829,7 +1830,7 @@ int CASW_Marine::OnTakeDamage_Alive( const CTakeDamageInfo &info ) } // Mari: Friendly fire from flamer should be considered regardless if it deals 0 damage - if (result > 0 || (bFriendlyFire && (info.GetDamageType() & DMG_BURN) && info.GetWeapon()->Classify() == CLASS_ASW_FLAMER)) + if (result > 0 || (bFriendlyFire && (info.GetDamageType() & DMG_BURN) && info.GetWeapon() && info.GetWeapon()->Classify() == CLASS_ASW_FLAMER)) { // update our stats CASW_Marine_Resource *pMR = GetMarineResource(); @@ -5065,7 +5066,7 @@ void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity * bool bFriendlyFire = IRelationType( pAttacker ) == D_LI; // Mari: special scaling for flamer ff - if (asw_marine_ff_absorption.GetInt() > 0 && bFriendlyFire && pDamagingWeapon->Classify() == CLASS_ASW_FLAMER) + if (asw_marine_ff_absorption.GetInt() > 0 && bFriendlyFire && pDamagingWeapon && pDamagingWeapon->Classify() == CLASS_ASW_FLAMER) { flFlameLifetime = MAX( flFlameLifetime*0.1875f, MIN( flFlameLifetime * m_fFriendlyFireAbsorptionTime, (m_fLastFriendlyFireTime + flFlameLifetime*0.2f - gpGlobals->curtime)*5.0f ) ); } From 10ae132035973792ec7b439760b1e2b9919cc3d9 Mon Sep 17 00:00:00 2001 From: ModdedMarionette Date: Thu, 7 Nov 2024 17:28:45 -0500 Subject: [PATCH 2/2] Resolving "conflict" --- src/game/server/swarm/asw_marine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/swarm/asw_marine.cpp b/src/game/server/swarm/asw_marine.cpp index beb2fa151..4d6de9e43 100644 --- a/src/game/server/swarm/asw_marine.cpp +++ b/src/game/server/swarm/asw_marine.cpp @@ -5066,7 +5066,7 @@ void CASW_Marine::ASW_Ignite( float flFlameLifetime, float flSize, CBaseEntity * bool bFriendlyFire = IRelationType( pAttacker ) == D_LI; // Mari: special scaling for flamer ff - if (asw_marine_ff_absorption.GetInt() > 0 && bFriendlyFire && pDamagingWeapon && pDamagingWeapon->Classify() == CLASS_ASW_FLAMER) + if ( asw_marine_ff_absorption.GetInt() > 0 && bFriendlyFire && pDamagingWeapon && pDamagingWeapon->Classify() == CLASS_ASW_FLAMER ) { flFlameLifetime = MAX( flFlameLifetime*0.1875f, MIN( flFlameLifetime * m_fFriendlyFireAbsorptionTime, (m_fLastFriendlyFireTime + flFlameLifetime*0.2f - gpGlobals->curtime)*5.0f ) ); }