Removed sandbox from shuffle list / duplicate maps / mobile mech pickup
This commit is contained in:
@@ -60,7 +60,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
public boolean achievedFlight;
|
public boolean achievedFlight;
|
||||||
public Color color = new Color();
|
public Color color = new Color();
|
||||||
public Mech mech;
|
public Mech mech;
|
||||||
public int spawner;
|
public int spawner = -1;
|
||||||
|
|
||||||
public NetConnection con;
|
public NetConnection con;
|
||||||
public int playerIndex = 0;
|
public int playerIndex = 0;
|
||||||
@@ -482,6 +482,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
setDead(true);
|
setDead(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(netServer.isWaitingForPlayers()){
|
||||||
|
setDead(true);
|
||||||
|
}
|
||||||
|
|
||||||
if(isDead()){
|
if(isDead()){
|
||||||
isBoosting = false;
|
isBoosting = false;
|
||||||
boostHeat = 0f;
|
boostHeat = 0f;
|
||||||
@@ -778,7 +782,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this);
|
((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this);
|
||||||
}else{
|
}else{
|
||||||
CoreEntity entity = (CoreEntity) getClosestCore();
|
CoreEntity entity = (CoreEntity) getClosestCore();
|
||||||
if(entity != null){
|
if(entity != null && !netServer.isWaitingForPlayers()){
|
||||||
this.spawner = entity.tile.id();
|
this.spawner = entity.tile.id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -859,7 +863,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
color.set(buffer.readInt());
|
color.set(buffer.readInt());
|
||||||
mech = content.getByID(ContentType.mech, buffer.readByte());
|
mech = content.getByID(ContentType.mech, buffer.readByte());
|
||||||
int mine = buffer.readInt();
|
int mine = buffer.readInt();
|
||||||
spawner = buffer.readInt();
|
int spawner = buffer.readInt();
|
||||||
float baseRotation = buffer.readShort() / 2f;
|
float baseRotation = buffer.readShort() / 2f;
|
||||||
|
|
||||||
readBuilding(buffer, !isLocal);
|
readBuilding(buffer, !isLocal);
|
||||||
@@ -873,6 +877,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
}else{
|
}else{
|
||||||
mining = world.tile(mine);
|
mining = world.tile(mine);
|
||||||
isBoosting = boosting;
|
isBoosting = boosting;
|
||||||
|
this.spawner = spawner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
//add to selection queue if it's a valid BREAK position
|
//add to selection queue if it's a valid BREAK position
|
||||||
cursor = cursor.target();
|
cursor = cursor.target();
|
||||||
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
|
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
|
||||||
}else if(!canTapPlayer(worldx, worldy)){
|
}else if(!canTapPlayer(worldx, worldy) && player.mech.flying){
|
||||||
boolean consumed = false;
|
boolean consumed = false;
|
||||||
//else, try and carry units
|
//else, try and carry units
|
||||||
if(player.getCarry() != null){
|
if(player.getCarry() != null){
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class Maps implements Disposable{
|
|||||||
|
|
||||||
/**Returns map by internal name.*/
|
/**Returns map by internal name.*/
|
||||||
public Map getByName(String name){
|
public Map getByName(String name){
|
||||||
return maps.get(name);
|
return maps.get(name.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Load all maps. Should be called at application start.*/
|
/**Load all maps. Should be called at application start.*/
|
||||||
@@ -81,6 +81,7 @@ public class Maps implements Disposable{
|
|||||||
ObjectMap<String, String> newTags = new ObjectMap<>();
|
ObjectMap<String, String> newTags = new ObjectMap<>();
|
||||||
newTags.putAll(tags);
|
newTags.putAll(tags);
|
||||||
tags = newTags;
|
tags = newTags;
|
||||||
|
|
||||||
if (!gwt) {
|
if (!gwt) {
|
||||||
FileHandle file = customMapDirectory.child(name + "." + mapExtension);
|
FileHandle file = customMapDirectory.child(name + "." + mapExtension);
|
||||||
MapIO.writeMap(file.write(false), tags, data);
|
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)));
|
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);
|
allMaps.add(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class ServerControl extends Module{
|
|||||||
if(Settings.getBool("shuffle")){
|
if(Settings.getBool("shuffle")){
|
||||||
if(world.getSector() == null){
|
if(world.getSector() == null){
|
||||||
if(world.maps.all().size > 0){
|
if(world.maps.all().size > 0){
|
||||||
Array<Map> maps = world.maps.all();
|
Array<Map> maps = world.maps.customMaps().size == 0 ? world.maps.defaultMaps() : world.maps.customMaps();
|
||||||
|
|
||||||
Map previous = world.getMap();
|
Map previous = world.getMap();
|
||||||
Map map = previous;
|
Map map = previous;
|
||||||
|
|||||||
Reference in New Issue
Block a user