{
//If this is the player currently using this MG, dismount
if(gunner == player)
{
mountGun(player, false);
FlansMod.getPacketHandler().sendToAllAround(new PacketMGMount(player, this, false), posX, posY, posZ, FlansMod.driveableUpdateRange, dimension);
return true;
}
//If this person is already mounting a gun, dismount it first
if(PlayerHandler.getPlayerData(player).mountingGun != null && !PlayerHandler.getPlayerData(player).mountingGun.isDead)
{
PlayerHandler.getPlayerData(player).mountingGun.mountGun(player, false);
return true;
}
//Spectators can't mount guns
if(TeamsManager.instance.currentRound != null && PlayerHandler.getPlayerData(player).team == Team.spectators)
return true;
//None of the above applied, so mount the gun
mountGun(player, true);
FlansMod.getPacketHandler().sendToAllAround(new PacketMGMount(player, this, true), posX, posY, posZ, FlansMod.driveableUpdateRange, dimension);
if (ammo == null)
{
int slot = findAmmo(player);
if (slot >= 0)
{