1
0
This commit is contained in:
2022-06-29 21:11:27 +05:00
parent 513c60070e
commit 670ad3af13
6 changed files with 218 additions and 35 deletions

View File

@ -48,6 +48,9 @@ var protected float PostAuthorityChangeLifeSpan;
/** Amount of delay before anything can pick this up */
var protected float PickupDelay;
/** Previous Owner (Added for Autoturret) */
var KFPlayerController PreviousOwner;
// Visuals
var bool bEmptyPickup; // pickup has an inventory with no ammo
var LinearColor EmptyPickupColor;
@ -430,6 +433,11 @@ function GiveTo(Pawn P)
KFW = KFWeapon(NewInventory);
if (KFW != none)
{
if (PreviousOWner != none)
{
KFW.KFPlayer = PreviousOwner;
}
KFW.SetOriginalValuesFromPickup(KFWeapon(Inventory));
KFW = KFIM.CombineWeaponsOnPickup(KFW);
KFW.NotifyPickedUp();

View File

@ -252,7 +252,12 @@ simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacit
// FAMAS needs its secondary ammo affected
// Autoturret cannot modify its magazine capacity
if( (!bSecondary || IsFAMAS(KFW)) && !IsAutoTurret(KFW) && IsWeaponOnPerk( KFW, WeaponPerkClass, self.class ) && (KFW == none || !KFW.bNoMagazine) )
if (IsAutoTurret(KFW) || WeaponClassName == 'KFWeap_Autoturret')
{
return;
}
if( (!bSecondary || IsFAMAS(KFW)) && IsWeaponOnPerk( KFW, WeaponPerkClass, self.class ) && (KFW == none || !KFW.bNoMagazine) )
{
if( IsLargeMagActive() )
{
@ -509,7 +514,7 @@ final private function bool IsEatLeadActive()
*
* @return true/false
*/
final private function bool IsAmmoVestActive()
simulated final private function bool IsAmmoVestActive()
{
return PerkSkills[ECommandoAmmoVest].bActive && IsPerkLevelAllowed(ECommandoAmmoVest);
}

View File

@ -9280,6 +9280,7 @@ reliable client function ClientDrawDebugCylinder(vector CylinderLocation, float
event Destroyed()
{
local KFProjectile KFProj;
local int i;
// Stop currently playing stingers when the map is being switched
if( StingerAkComponent != none )
@ -9289,10 +9290,11 @@ event Destroyed()
// Destroy deployed turrets
// Destroyed event on Turret calls the KFPlayer to modify the same list, that's why we use a while loop...
while (DeployedTurrets.Length > 0)
for (i = 0; i < DeployedTurrets.Length; i++)
{
DeployedTurrets[0].Destroy();
DeployedTurrets[i].Destroy();
}
DeployedTurrets.Remove(0, DeployedTurrets.Length);
SetRTPCValue( 'Health', 100, true );
PostAkEvent( LowHealthStopEvent );