KF2-TAWOD/TAWOD/Classes/TAWODMut.uc

47 lines
1.0 KiB
Ucode
Raw Normal View History

2021-01-31 10:13:35 +00:00
Class TAWODMut extends KFMutator;
simulated event PostBeginPlay()
{
super.PostBeginPlay();
if (WorldInfo.Game.BaseMutator == None)
WorldInfo.Game.BaseMutator = Self;
else
WorldInfo.Game.BaseMutator.AddMutator(Self);
if (bDeleteMe)
return;
`Log("[TAWOD] Loaded mutator.");
}
function AddMutator(Mutator Mut)
{
if (Mut == Self)
return;
if (Mut.Class == Class)
Mut.Destroy();
else
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);
}
2021-01-31 10:13:35 +00:00
defaultproperties
{
}