From 4210070d07e571f56acc000508d2c1fbb6e9c5bb Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 29 Sep 2019 10:06:17 -0400 Subject: [PATCH] Fixed server map shuffling --- gradle.properties | 2 +- server/src/io/anuke/mindustry/server/ServerControl.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 520558812f..678dbb3d37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=151dc8b70276b74c612d23b01573f7a8452c2b69 +archash=d4519a9721927165850bfe3135ef6b095c990474 diff --git a/server/src/io/anuke/mindustry/server/ServerControl.java b/server/src/io/anuke/mindustry/server/ServerControl.java index fd1c0ca1bd..4ccb45f2b3 100644 --- a/server/src/io/anuke/mindustry/server/ServerControl.java +++ b/server/src/io/anuke/mindustry/server/ServerControl.java @@ -155,7 +155,7 @@ public class ServerControl implements ApplicationListener{ maps.shuffle(); Map previous = world.getMap(); - Map map = maps.find(m -> m != previous); + Map map = maps.find(m -> m != previous || maps.size == 1); if(map != null){ @@ -168,6 +168,8 @@ public class ServerControl implements ApplicationListener{ info("Selected next map to be {0}.", map.name()); play(true, () -> world.loadMap(map, map.applyRules(lastMode))); + }else{ + Log.err("No suitable map found."); } } }else{