Fixed mobile mechs configuration / Block selection / Crash
This commit is contained in:
@@ -83,6 +83,12 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBars(){
|
||||||
|
super.setBars();
|
||||||
|
bars.remove(BarType.inventory);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
SorterEntity entity = tile.entity();
|
SorterEntity entity = tile.entity();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class OverlayRenderer{
|
|||||||
public void drawTop(){
|
public void drawTop(){
|
||||||
|
|
||||||
for(Player player : players){
|
for(Player player : players){
|
||||||
if(player.isDead()) continue; //dead player don't draw
|
if(player.isDead()) continue; //dead players don't draw
|
||||||
|
|
||||||
InputHandler input = control.input(player.playerIndex);
|
InputHandler input = control.input(player.playerIndex);
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ public class OverlayRenderer{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
//draw selected block bars and info
|
//draw selected block bars and info
|
||||||
if(input.recipe == null && !ui.hasMouse() && !input.frag.config.isShown()){
|
if(input.recipe == null && !ui.hasMouse()){
|
||||||
Vector2 vec = Graphics.world(input.getMouseX(), input.getMouseY());
|
Vector2 vec = Graphics.world(input.getMouseX(), input.getMouseY());
|
||||||
Tile tile = world.tileWorld(vec.x, vec.y);
|
Tile tile = world.tileWorld(vec.x, vec.y);
|
||||||
|
|
||||||
|
|||||||
@@ -567,19 +567,21 @@ 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) && player.mech.flying){
|
}else if(!canTapPlayer(worldx, worldy)){
|
||||||
boolean consumed = false;
|
boolean consumed = false;
|
||||||
//else, try and carry units
|
//else, try and carry units
|
||||||
if(player.getCarry() != null){
|
if(player.mech.flying){
|
||||||
consumed = true;
|
if(player.getCarry() != null){
|
||||||
player.dropCarry(); //drop off unit
|
|
||||||
}else{
|
|
||||||
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
|
|
||||||
|
|
||||||
if(unit != null){
|
|
||||||
player.moveTarget = unit;
|
|
||||||
consumed = true;
|
consumed = true;
|
||||||
Effects.effect(Fx.select, unit.getX(), unit.getY());
|
player.dropCarry(); //drop off unit
|
||||||
|
}else{
|
||||||
|
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
|
||||||
|
|
||||||
|
if(unit != null){
|
||||||
|
player.moveTarget = unit;
|
||||||
|
consumed = true;
|
||||||
|
Effects.effect(Fx.select, unit.getX(), unit.getY());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
@Remote(called = Loc.server)
|
@Remote(called = Loc.server)
|
||||||
public static void setCoreSolid(Tile tile, boolean solid){
|
public static void setCoreSolid(Tile tile, boolean solid){
|
||||||
|
if(tile == null) return;
|
||||||
CoreEntity entity = tile.entity();
|
CoreEntity entity = tile.entity();
|
||||||
if(entity != null) entity.solid = solid;
|
if(entity != null) entity.solid = solid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user