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

33 lines
1005 B
Ucode
Raw Normal View History

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