From UTComp_GameRules.uc
Code: Select all
function int NetDamage( int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType )
{
local byte HitSoundType;
local UTComp_PRI uPRI;
local controller C;
if(Damage>0 && InstigatedBy!=None && Injured!=None && InstigatedBy.Controller!=None && BS_xPlayer(InstigatedBy.Controller)!=None)
{
if(UTCompMutator.EnableHitSoundsMode>0)
{
BS_xPlayer(InstigatedBy.Controller).ReceiveHit(DamageType, Damage, Injured);
if(InstigatedBy==Injured)
HitSoundType=0;
else if(InstigatedBy.GetTeamNum()==255 || InstigatedBy.GetTeamNum() != Injured.GetTeamNum())
HitSoundType=1;
else
HitSoundType=2;
for(C=Level.ControllerList; C!=None; C=C.NextController)
{
if(BS_xPlayer(C)!=None && C.PlayerReplicationInfo!=None && (C.PlayerReplicationInfo.bOnlySpectator || C.PlayerReplicationInfo.bOutOfLives) && PlayerController(C).ViewTarget == InstigatedBy)
{
BS_xPlayer(C).ReceiveHitSound(Damage, HitSoundType);
}
}
}
else if(BS_xPlayer(InstigatedBy.Controller).bWantsStats && UTCompMutator.bEnableWeaponStats)
{
BS_xPlayer(InstigatedBy.Controller).ReceiveStats(DamageType, Damage, Injured);
}
BS_xPlayer(InstigatedBy.Controller).ServerReceiveHit(DamageType, Damage, Injured);
}
if(Injured!=None && Injured.Controller!=None && BS_xPlayer(Injured.Controller)!=None)
{
uPRI=Class'UTComp_Util'.Static.GetUTCompPRIForPawn(Injured);
if(uPRI!=None)
uPRI.DamR+=Damage;
}
if ( NextGameRules != None )
return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
return Damage;
}
Could it be the UTComp_GameRules is missing?
Damage = super.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
But looking at other code, that's not there in some mods either....
And Forward_GameRules (in UTComp) is missing, but not sure if that's even used/called?
if ( NextGameRules != None )
return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
And in the original ONSPLus GameRules:
Code: Select all
function int NetDamage(int OriginalDamage, int Damage, pawn injured, pawn instigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType)
{
local float CurDamage;
CurDamage = Super.NetDamage(OriginalDamage, Damage, injured, instigatedBy, HitLocation, Momentum, DamageType);
if (DamageType != Class'DamTypeLinkShaft' && DamageType != Class'DamTypeLinkPlasma' && injured != None
&& Vehicle(injured) != None && !Vehicle(injured).IsVehicleEmpty() && instigatedBy != None
&& instigatedBy != injured && CurDamage > 0 && instigatedBy.Controller != none
&& instigatedBy.Controller.PlayerReplicationInfo != none
&& ONSPlusPlayerReplicationInfo(instigatedBy.Controller.PlayerReplicationInfo) != none)
{
if (OPGRI == none && PlayerController(instigatedBy.Controller) != none && PlayerController(instigatedBy.Controller).GameReplicationInfo != none
&& ONSPlusGameReplicationInfo(PlayerController(instigatedBy.Controller).GameReplicationInfo) != none)
OPGRI = ONSPlusGameReplicationInfo(PlayerController(instigatedBy.Controller).GameReplicationInfo);
if (OPGRI != none)
{
if (Vehicle(injured).Team != instigatedBy.Controller.PlayerReplicationInfo.TeamID)
ONSPlusPlayerReplicationInfo(instigatedBy.Controller.PlayerReplicationInfo).AddVehicleDamageBonus(CurDamage / OPGRI.DamageScoreQuota);
else
ONSPlusPlayerReplicationInfo(instigatedBy.Controller.PlayerReplicationInfo).AddVehicleDamageBonus(-1.0 * CurDamage / OPGRI.DamageScoreQuota);
}
}
return CurDamage;
}
Its missing
if ( NextGameRules != None )
return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
So its a bit confusing whether
if ( NextGameRules != None )
return NextGameRules.NetDamage( OriginalDamage,Damage,injured,instigatedBy,HitLocation,Momentum,DamageType );
is needed (I would think if we have multiple mutators with .NetDamage Functions want them to be called, but wouldn't
CurDamage = Super.NetDamage(OriginalDamage, Damage, injured, instigatedBy, HitLocation, Momentum, DamageType);
Kind of do the same thing, but only for SuperClasses of the mutator. But most game rules seems to follow this:
Class UTComp_ONSGameRules extends GameRules;
So calling Super is really just calling GameRules.NetDamage anyway, since I don't think I've ever seen a game rules extend anything but GameRules.