KF2-Server-Extension/ServerExt/Classes/Ext_TraitSupplyData.uc
2017-10-19 21:00:49 -05:00

31 lines
1013 B
Ucode

Class Ext_TraitSupplyData extends Ext_TraitDataStore;
var Ext_T_SupplierInteract SupplyInteraction;
final function SpawnSupplier( KFPawn_Human H, optional bool bGrenades )
{
if( SupplyInteraction!=None )
SupplyInteraction.Destroy();
SupplyInteraction = Spawn( class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true );
SupplyInteraction.SetBase( H );
SupplyInteraction.PlayerOwner = H;
SupplyInteraction.PerkOwner = Perk;
SupplyInteraction.bGrenades = bGrenades;
if( PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None )
ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = class<Ext_TraitSupply>(TraitClass);
}
final function RemoveSupplier()
{
if( SupplyInteraction!=None )
SupplyInteraction.Destroy();
if( PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None )
ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None;
}
function Destroyed()
{
RemoveSupplier();
}