From f8d068281015cb5752a7e1a3c283ff9736eccbdf Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 13 Oct 2018 15:49:18 -0400 Subject: [PATCH] Added warnings for missing enemy cores --- core/assets/bundles/bundle.properties | 3 ++- core/src/io/anuke/mindustry/core/World.java | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 41f89120a5..7c906733be 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -216,7 +216,8 @@ text.custom=Custom text.builtin=Built-In 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.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.editor.brush=Brush text.editor.slope=\\ diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 931bf6d6a5..3c07eb6354 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -254,14 +254,27 @@ public class World extends Module{ return; } - if(!headless && state.teams.get(players[0].getTeam()).cores.size == 0){ - ui.showError("$text.map.nospawn"); - threads.runDelay(() -> state.set(State.menu)); - invalidMap = true; + if(!headless){ + if(state.teams.get(players[0].getTeam()).cores.size == 0){ + ui.showError("$text.map.nospawn"); + 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{ invalidMap = false; } + if(invalidMap) threads.runDelay(() -> state.set(State.menu)); + endMapLoad(); }