Forced hovering while on block
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user