Added warnings for missing enemy cores

This commit is contained in:
Anuken
2018-10-13 15:49:18 -04:00
parent ae6a5b2512
commit f8d0682810
2 changed files with 19 additions and 5 deletions

View File

@@ -217,6 +217,7 @@ text.builtin=Built-In
text.map.delete.confirm=Are you sure you want to delete this map? This action cannot be undone! text.map.delete.confirm=Are you sure you want to delete this map? This action cannot be undone!
text.map.random=[accent]Random Map text.map.random=[accent]Random Map
text.map.nospawn=This map does not have any cores for the player to spawn in! Add a[ROYAL] blue[] core to this map in the editor. text.map.nospawn=This map does not have any cores for the player to spawn in! Add a[ROYAL] blue[] core to this map in the editor.
text.map.nospawn.pvp=This map does not have any enemy cores for player to spawn into! Add[SCARLET] red[] cores to this map in the editor.
text.map.invalid=Error loading map: corrupted or invalid map file. text.map.invalid=Error loading map: corrupted or invalid map file.
text.editor.brush=Brush text.editor.brush=Brush
text.editor.slope=\\ text.editor.slope=\\

View File

@@ -254,14 +254,27 @@ public class World extends Module{
return; return;
} }
if(!headless && state.teams.get(players[0].getTeam()).cores.size == 0){ if(!headless){
if(state.teams.get(players[0].getTeam()).cores.size == 0){
ui.showError("$text.map.nospawn"); ui.showError("$text.map.nospawn");
threads.runDelay(() -> state.set(State.menu));
invalidMap = true; invalidMap = true;
}else if(state.mode.isPvp){
invalidMap = true;
for(Team team : Team.all){
if(state.teams.get(team).cores.size != 0 && team != players[0].getTeam()){
invalidMap = false;
}
}
if(invalidMap){
ui.showError("$text.map.nospawn.pvp");
}
}
}else{ }else{
invalidMap = false; invalidMap = false;
} }
if(invalidMap) threads.runDelay(() -> state.set(State.menu));
endMapLoad(); endMapLoad();
} }