Fixes an issue where if players in SSM destroyed all of the spawn point
locations, players would not be handled correctly
This commit is contained in:
Sam 2016-06-19 17:10:22 +01:00
parent d167f93486
commit e8b8a3cd66

View File

@ -21,8 +21,10 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.kit.SmashPerk;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -165,6 +167,16 @@ public class PerkCreeperExplode extends SmashPerk
if (UtilMath.offset(player.getLocation(), spawn) < 14)
spawnIterator.remove();
}
//If all spawns have been destroyed revert to using the spectator spawn
for (GameTeam team : Manager.GetGame().GetTeamList())
{
if (team.GetSpawns().isEmpty())
{
Bukkit.broadcastMessage(F.main("Debug", "Ran out of spawns!"));
team.GetSpawns().add(Manager.GetGame().GetSpectatorLocation());
}
}
}
//Damage