add short alias for mutator
This commit is contained in:
42
TAWOD/Classes/Mut.uc
Normal file
42
TAWOD/Classes/Mut.uc
Normal file
@ -0,0 +1,42 @@
|
||||
class Mut extends KFMutator;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
return (bPendingDelete || bDeleteMe || Destroy());
|
||||
}
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
`log("Loaded.", true, 'TAWOD');
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator M)
|
||||
{
|
||||
if (M == Self) return;
|
||||
|
||||
if (M.Class == Class)
|
||||
Mut(M).SafeDestroy();
|
||||
else
|
||||
Super.AddMutator(M);
|
||||
}
|
||||
|
||||
public 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,37 +1 @@
|
||||
class TAWODMut extends KFMutator;
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
`log("Loaded.", true, 'TAWOD');
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator Mut)
|
||||
{
|
||||
if (Mut == Self) return;
|
||||
|
||||
if (Mut.Class == Class)
|
||||
Mut.Destroy();
|
||||
else
|
||||
Super.AddMutator(Mut);
|
||||
}
|
||||
|
||||
public 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
|
||||
{
|
||||
|
||||
}
|
||||
class TAWODMut extends Mut; // backward compatibility
|
||||
|
Reference in New Issue
Block a user