KF2-Server-Extension/ServerExt/Classes/Ext_TraitSupplyData.uc

33 lines
1005 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class Ext_TraitSupplyData extends Ext_TraitDataStore;
var Ext_T_SupplierInteract SupplyInteraction;
2020-11-28 20:04:55 +00:00
final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (SupplyInteraction!=None)
2017-10-20 02:00:49 +00:00
SupplyInteraction.Destroy();
2020-11-28 20:04:55 +00:00
SupplyInteraction = Spawn(class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true);
SupplyInteraction.SetBase(H);
2017-10-20 02:00:49 +00:00
SupplyInteraction.PlayerOwner = H;
SupplyInteraction.PerkOwner = Perk;
SupplyInteraction.bGrenades = bGrenades;
2020-11-28 20:12:58 +00:00
if (PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None)
2017-10-20 02:00:49 +00:00
ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = class<Ext_TraitSupply>(TraitClass);
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
final function RemoveSupplier()
{
2020-11-28 20:12:58 +00:00
if (SupplyInteraction!=None)
2017-10-20 02:00:49 +00:00
SupplyInteraction.Destroy();
2020-11-28 20:12:58 +00:00
if (PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None)
2017-10-20 02:00:49 +00:00
ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None;
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
function Destroyed()
{
RemoveSupplier();
}