PC-504
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:
parent
d167f93486
commit
e8b8a3cd66
|
@ -21,8 +21,10 @@ import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.kit.SmashPerk;
|
import nautilus.game.arcade.kit.SmashPerk;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
@ -165,6 +167,16 @@ public class PerkCreeperExplode extends SmashPerk
|
||||||
if (UtilMath.offset(player.getLocation(), spawn) < 14)
|
if (UtilMath.offset(player.getLocation(), spawn) < 14)
|
||||||
spawnIterator.remove();
|
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
|
//Damage
|
||||||
|
|
Loading…
Reference in New Issue