From e8b8a3cd66f2c725fa5c1affa91b13136cb712fb Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 19 Jun 2016 17:10:22 +0100 Subject: [PATCH] PC-504 Fixes an issue where if players in SSM destroyed all of the spawn point locations, players would not be handled correctly --- .../game/arcade/kit/perks/PerkCreeperExplode.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java index 5a97d8a8f..2f30b18fa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java @@ -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