improved compatibility with mutators that replace the KFPawn_Human class
This commit is contained in:
parent
80fe8a5022
commit
337cc55b55
@ -12,8 +12,6 @@ simulated event PostBeginPlay()
|
||||
if (bDeleteMe)
|
||||
return;
|
||||
|
||||
WorldInfo.Game.DefaultPawnClass = class'TAWODPawn_Human';
|
||||
|
||||
`Log("[TAWOD] Loaded mutator.");
|
||||
}
|
||||
|
||||
@ -28,6 +26,21 @@ function AddMutator(Mutator Mut)
|
||||
Super.AddMutator(Mut);
|
||||
}
|
||||
|
||||
function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
|
||||
{
|
||||
local KFWeapon TempWeapon;
|
||||
local KFPawn_Human KFP;
|
||||
|
||||
KFP = KFPawn_Human(Killed);
|
||||
|
||||
if (Role >= ROLE_Authority && KFP != None && KFP.InvManager != none)
|
||||
foreach KFP.InvManager.InventoryActors(class'KFWeapon', TempWeapon)
|
||||
if (TempWeapon != none && TempWeapon.bDropOnDeath && TempWeapon.CanThrow())
|
||||
KFP.TossInventory(TempWeapon);
|
||||
|
||||
return Super.PreventDeath(Killed, Killer, damageType, HitLocation);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
class TAWODPawn_Human extends KFPawn_Human;
|
||||
|
||||
function ThrowActiveWeapon( optional bool bDestroyWeap )
|
||||
{
|
||||
local KFWeapon TempWeapon;
|
||||
|
||||
if( Role < ROLE_Authority )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Health <= 0)
|
||||
{
|
||||
if (InvManager != none)
|
||||
foreach InvManager.InventoryActors(class'KFWeapon', TempWeapon)
|
||||
if (TempWeapon.bDropOnDeath && TempWeapon.CanThrow())
|
||||
if (TempWeapon != none)
|
||||
TossInventory(TempWeapon);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.ThrowActiveWeapon( bDestroyWeap );
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user