This commit is contained in:
Anuken 2019-06-17 12:18:10 -04:00
parent 4f40f3c4b2
commit 2804361436

View File

@ -23,8 +23,13 @@ public class MapPlayDialog extends FloatingDialog{
public void show(Map map){ public void show(Map map){
title.setText(map.name()); title.setText(map.name());
cont.clearChildren(); 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()); rules = selectedGamemode.apply(map.rules());
Table selmode = new Table(); Table selmode = new Table();