diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 82292dd224..bae29946cf 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -60,7 +60,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra public boolean achievedFlight; public Color color = new Color(); public Mech mech; - public int spawner; + public int spawner = -1; public NetConnection con; public int playerIndex = 0; @@ -482,6 +482,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra setDead(true); } + if(netServer.isWaitingForPlayers()){ + setDead(true); + } + if(isDead()){ isBoosting = false; boostHeat = 0f; @@ -778,7 +782,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra ((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this); }else{ CoreEntity entity = (CoreEntity) getClosestCore(); - if(entity != null){ + if(entity != null && !netServer.isWaitingForPlayers()){ this.spawner = entity.tile.id(); } } @@ -859,7 +863,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra color.set(buffer.readInt()); mech = content.getByID(ContentType.mech, buffer.readByte()); int mine = buffer.readInt(); - spawner = buffer.readInt(); + int spawner = buffer.readInt(); float baseRotation = buffer.readShort() / 2f; readBuilding(buffer, !isLocal); @@ -873,6 +877,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra }else{ mining = world.tile(mine); isBoosting = boosting; + this.spawner = spawner; } } diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 9b6b7e278d..d1b56e4105 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -567,7 +567,7 @@ public class MobileInput extends InputHandler implements GestureListener{ //add to selection queue if it's a valid BREAK position cursor = cursor.target(); selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy())); - }else if(!canTapPlayer(worldx, worldy)){ + }else if(!canTapPlayer(worldx, worldy) && player.mech.flying){ boolean consumed = false; //else, try and carry units if(player.getCarry() != null){ diff --git a/core/src/io/anuke/mindustry/maps/Maps.java b/core/src/io/anuke/mindustry/maps/Maps.java index d97cdbfa9e..6493bbb0f3 100644 --- a/core/src/io/anuke/mindustry/maps/Maps.java +++ b/core/src/io/anuke/mindustry/maps/Maps.java @@ -57,7 +57,7 @@ public class Maps implements Disposable{ /**Returns map by internal name.*/ public Map getByName(String name){ - return maps.get(name); + return maps.get(name.toLowerCase()); } /**Load all maps. Should be called at application start.*/ @@ -81,6 +81,7 @@ public class Maps implements Disposable{ ObjectMap newTags = new ObjectMap<>(); newTags.putAll(tags); tags = newTags; + if (!gwt) { FileHandle file = customMapDirectory.child(name + "." + mapExtension); MapIO.writeMap(file.write(false), tags, data); @@ -144,7 +145,7 @@ public class Maps implements Disposable{ map.texture = new Texture(MapIO.generatePixmap(MapIO.readTileData(ds, meta, true))); } - maps.put(map.name, map); + maps.put(map.name.toLowerCase(), map); allMaps.add(map); } } diff --git a/server/src/io/anuke/mindustry/server/ServerControl.java b/server/src/io/anuke/mindustry/server/ServerControl.java index 0a4b58a8ac..b8a88fb15c 100644 --- a/server/src/io/anuke/mindustry/server/ServerControl.java +++ b/server/src/io/anuke/mindustry/server/ServerControl.java @@ -112,7 +112,7 @@ public class ServerControl extends Module{ if(Settings.getBool("shuffle")){ if(world.getSector() == null){ if(world.maps.all().size > 0){ - Array maps = world.maps.all(); + Array maps = world.maps.customMaps().size == 0 ? world.maps.defaultMaps() : world.maps.customMaps(); Map previous = world.getMap(); Map map = previous;