From 2804361436f5f761c3c6ce4efb627b67fb77f0ff Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 17 Jun 2019 12:18:10 -0400 Subject: [PATCH] Bugfix --- core/src/io/anuke/mindustry/ui/dialogs/MapPlayDialog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/ui/dialogs/MapPlayDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/MapPlayDialog.java index ba39b2f0fe..58ad128e80 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/MapPlayDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/MapPlayDialog.java @@ -23,8 +23,13 @@ public class MapPlayDialog extends FloatingDialog{ public void show(Map map){ title.setText(map.name()); cont.clearChildren(); - rules = map.rules(); + //reset to a valid mode after switching to attack + if((selectedGamemode == Gamemode.attack && !map.hasEnemyCore()) || (selectedGamemode == Gamemode.pvp && !map.hasOtherCores())){ + selectedGamemode = Gamemode.survival; + } + + rules = map.rules(); rules = selectedGamemode.apply(map.rules()); Table selmode = new Table();