class KFExplosivesFixRule extends GameRules;

function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
	local TeamGame TG;

	TG = TeamGame(Level.Game);

	if ( KFPawn(injured) != None && TG != None && Damage > 0 )
	{
		if ( (KFPawn(instigatedBy) != None || FakePlayerPawn(instigatedBy) != None ) && (instigatedBy.PlayerReplicationInfo == None || instigatedBy.PlayerReplicationInfo.bOnlySpectator) )
		{
			Momentum = vect(0,0,0);
			if ( NoFF(injured, TG.FriendlyFireScale) )
				return 0;
			else if ( OriginalDamage == Damage )
				return Damage*TG.FriendlyFireScale;
		}
		else if ( instigatedBy == None && !DamageType.default.bCausedByWorld )
		{
			Momentum = vect(0,0,0);
			if ( NoFF(injured, TG.FriendlyFireScale) )
				return 0;
			else if ( OriginalDamage == Damage )
				return Damage*TG.FriendlyFireScale;
		}
	}

	return Super.NetDamage( OriginalDamage, Damage, injured, instigatedBy, HitLocation, Momentum,DamageType );
}

function bool NoFF( Pawn injured, float FF )
{
	return (FF == 0.0 || (Vehicle(injured) != None && Vehicle(injured).bNoFriendlyFire));
}

defaultproperties
{
}
