Fixes not being able to reload dropped guns w/ 0 ammo.
This commit is contained in:
parent
979e68dcc7
commit
46bf963d44
@ -107,6 +107,9 @@ public abstract class StrikeItem
|
||||
|
||||
if (this instanceof Gun)
|
||||
{
|
||||
//Fixes it so it stops reloading when dropped. Allows other players to reload when it's dropped if its ammo is 0.
|
||||
((Gun) this).forceCancelReload(player);
|
||||
|
||||
game.deregisterGun((Gun)this);
|
||||
|
||||
if (!onlyDeregisterAndRemove)
|
||||
|
@ -95,7 +95,7 @@ public abstract class Grenade extends StrikeItem
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
|
||||
if ((player.getInventory().getItem(i) == null || UtilInv.IsItem(player.getInventory().getItem(i), Material.AIR, (byte) -1)) && bestSlot == -1)
|
||||
if ((player.getInventory().getItem(i) == null || isStack(player.getInventory().getItem(i))) && bestSlot == -1)
|
||||
bestSlot = i;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public abstract class Grenade extends StrikeItem
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
|
||||
if ((player.getInventory().getItem(i) == null || UtilInv.IsItem(player.getInventory().getItem(i), Material.AIR, (byte) -1)) && bestSlot == -1)
|
||||
if ((player.getInventory().getItem(i) == null || isStack(player.getInventory().getItem(i))) && bestSlot == -1)
|
||||
bestSlot = i;
|
||||
}
|
||||
|
||||
|
@ -269,6 +269,12 @@ public class Gun extends StrikeItem
|
||||
|
||||
_reloading = true;
|
||||
}
|
||||
|
||||
public void forceCancelReload(Player player)
|
||||
{
|
||||
_reloading = false;
|
||||
Recharge.Instance.recharge(player, getName() + " Reload");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixStackName()
|
||||
|
Loading…
Reference in New Issue
Block a user