Forced hovering while on block

This commit is contained in:
Anuken
2018-08-21 17:28:35 -04:00
parent dbb164f4be
commit 3bf72a1af6
2 changed files with 5 additions and 6 deletions

View File

@@ -500,9 +500,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
achievedFlight = false; achievedFlight = false;
} }
isBoosting = Inputs.keyDown("dash") && !mech.flying;
//if player is in solid block //if player is in solid block
if(tile != null && tile.solid() && !isFlying()){ if(tile != null && tile.solid()){
damage(health + 1); //die instantly isBoosting = true;
} }
float speed = isBoosting && !mech.flying ? mech.boostSpeed : mech.speed; float speed = isBoosting && !mech.flying ? mech.boostSpeed : mech.speed;
@@ -526,8 +528,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
}else if(getCarry() != null){ }else if(getCarry() != null){
dropCarry(); dropCarry();
}else{ }else{
Unit unit = Units.getClosest(team, x, y, 8f, Unit unit = Units.getClosest(team, x, y, 8f, u -> !u.isFlying() && u.getMass() <= mech.carryWeight);
u -> !u.isFlying() && u.getMass() <= mech.carryWeight);
if(unit != null){ if(unit != null){
carry(unit); carry(unit);

View File

@@ -168,8 +168,6 @@ public class DesktopInput extends InputHandler{
Settings.save(); Settings.save();
} }
player.isBoosting = Inputs.keyDown("dash");
//deslect if not placing //deslect if not placing
if(!isPlacing() && mode == placing){ if(!isPlacing() && mode == placing){
mode = none; mode = none;