Random in-game music, untested

This commit is contained in:
Anuken
2019-08-10 18:56:20 -04:00
parent 4ef60af4a8
commit 2341da995e
10 changed files with 199 additions and 82 deletions

View File

@@ -147,12 +147,7 @@ public class ServerControl implements ApplicationListener{
Array<Map> maps = world.maps.customMaps().size == 0 ? world.maps.defaultMaps() : world.maps.customMaps();
Map previous = world.getMap();
Map map = previous;
if(maps.size > 1){
while(map == previous) map = maps.random();
}else if(!previous.custom && !world.maps.customMaps().isEmpty()){
map = maps.first();
}
Map map = maps.random(previous);
Call.onInfoMessage((state.rules.pvp
? "[YELLOW]The " + event.winner.name() + " team is victorious![]" : "[SCARLET]Game over![]")
@@ -162,9 +157,7 @@ public class ServerControl implements ApplicationListener{
info("Selected next map to be {0}.", map.name());
Map fmap = map;
play(true, () -> world.loadMap(fmap));
play(true, () -> world.loadMap(map));
}
}else{
netServer.kickAll(KickReason.gameover);