From cad2952c4654750b9329779ec37249e2d9e5160f Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 30 May 2020 13:39:09 -0500 Subject: [PATCH] [issue #140] fix bug with friendly fire being disabled with custom callbacks on IW4x --- GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc b/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc index efe725204..8ffb26785 100644 --- a/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc +++ b/GameFiles/IW4x/userraw/scripts/_customcallbacks.gsc @@ -230,14 +230,14 @@ Process_Hit( type, attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon ) Callback_PlayerDamage( eInflictor, attacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime ) { - if ( level.teamBased && isDefined( attacker ) && ( self != attacker ) && isDefined( attacker.team ) && ( self.pers[ "team" ] == attacker.team ) ) - { - return; - } - if ( self.health - iDamage > 0 ) { - self Process_Hit( "Damage", attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon ); + isFriendlyFire = level.teamBased && isDefined( attacker ) && ( self != attacker ) && isDefined( attacker.team ) && ( self.pers[ "team" ] == attacker.team ); + + if ( !isFriendlyFire ) + { + self Process_Hit( "Damage", attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon ); + } } self maps\mp\gametypes\_damage::Callback_PlayerDamage( eInflictor, attacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );