diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 118e68a91f..45048784b3 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -168,6 +168,7 @@ 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.editor.slope=\\ text.editor.openin=Open In Editor text.editor.oregen=Ore Generation diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 8c987933bf..af7e3ed4c9 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -27,7 +27,7 @@ import io.anuke.ucore.util.OS; import java.util.Locale; public class Vars{ - public static final boolean testMobile = true; + public static final boolean testMobile = false; //shorthand for whether or not this is running on android or ios public static boolean mobile; public static boolean ios; diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 21c355a530..dc97f4b24b 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -126,7 +126,9 @@ public class Logic extends Module { Timers.update(); } - checkGameOver(); + if(!world.isInvalidMap()){ + checkGameOver(); + } if(!state.is(State.paused) || Net.active()){ diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 596734a981..8bfc9d9f0d 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.ObjectMap; import io.anuke.mindustry.ai.BlockIndexer; import io.anuke.mindustry.ai.Pathfinder; import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.io.*; @@ -34,7 +35,7 @@ public class World extends Module{ private Maps maps = new Maps(); private Array tempTiles = new ThreadArray<>(); - private boolean generating; + private boolean generating, invalidMap; public World(){ maps.load(); @@ -56,7 +57,11 @@ public class World extends Module{ public Pathfinder pathfinder(){ return pathfinder; } - + + public boolean isInvalidMap() { + return invalidMap; + } + public boolean solid(int x, int y){ Tile tile = tile(x, y); @@ -216,6 +221,14 @@ public class World extends Module{ WorldGenerator.loadTileData(tiles, MapIO.readTileData(map, true), map.meta.hasOreGen(), seed); + if(!headless && state.teams.get(players[0].getTeam()).cores.size == 0){ + ui.showError("$text.map.nospawn"); + threads.runDelay(() -> state.set(State.menu)); + invalidMap = true; + }else{ + invalidMap = false; + } + endMapLoad(); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index df50e8daeb..1665c30093 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -116,7 +116,7 @@ public class MenuFragment implements Fragment{ FloatingDialog dialog = new FloatingDialog("$text.play"); dialog.addCloseButton(); - dialog.content().defaults().height(70f).width(w).padRight(5f); + dialog.content().defaults().height(66f).width(w).padRight(5f); dialog.content().add(new MenuButton("icon-play-2", "$text.newgame", () -> { dialog.hide();