Disable naval units on ground / Mobile payload input

This commit is contained in:
Anuken
2020-08-17 16:15:51 -04:00
parent 9a48028508
commit 7ecf5aa26d
11 changed files with 83 additions and 32 deletions

View File

@@ -35,6 +35,20 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
}
}
@Override
@Replace
public void lookAt(float angle){
if(onLiquid()){
rotation = Angles.moveToward(rotation, angle, type.rotateSpeed * Time.delta);
}
}
@Override
@Replace
public boolean canShoot(){
return onLiquid();
}
@Override
public void add(){
tleft.clear();
@@ -79,5 +93,9 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
return on.isDeep() ? 1.3f : 1f;
}
public boolean onLiquid(){
return floorOn().isLiquid;
}
}