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;
}
isBoosting = Inputs.keyDown("dash") && !mech.flying;
//if player is in solid block
if(tile != null && tile.solid() && !isFlying()){
damage(health + 1); //die instantly
if(tile != null && tile.solid()){
isBoosting = true;
}
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){
dropCarry();
}else{
Unit unit = Units.getClosest(team, x, y, 8f,
u -> !u.isFlying() && u.getMass() <= mech.carryWeight);
Unit unit = Units.getClosest(team, x, y, 8f, u -> !u.isFlying() && u.getMass() <= mech.carryWeight);
if(unit != null){
carry(unit);

View file

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