fix: reload when adding secondary ammo
This commit is contained in:
parent
9a15562e91
commit
1f99accda4
@ -15,6 +15,7 @@ function Timer()
|
|||||||
{
|
{
|
||||||
local KFWeapon W;
|
local KFWeapon W;
|
||||||
local byte i;
|
local byte i;
|
||||||
|
local int ExtraAmmo;
|
||||||
|
|
||||||
if( PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None )
|
if( PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None )
|
||||||
Destroy();
|
Destroy();
|
||||||
@ -26,7 +27,15 @@ function Timer()
|
|||||||
{
|
{
|
||||||
if( W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i] )
|
if( W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i] )
|
||||||
{
|
{
|
||||||
W.SpareAmmoCount[i] = Min(W.SpareAmmoCount[i]+FMax(float(W.SpareAmmoCapacity[i])*RegCount,1.f),W.SpareAmmoCapacity[i]);
|
ExtraAmmo = Min(FMax(float(W.SpareAmmoCapacity[i])*RegCount,1.f),W.SpareAmmoCapacity[i]);
|
||||||
|
if ( i==0 )
|
||||||
|
{
|
||||||
|
W.AddAmmo(ExtraAmmo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
W.AddSecondaryAmmo(ExtraAmmo);
|
||||||
|
}
|
||||||
W.bNetDirty = true;
|
W.bNetDirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user