Fixed naval units with canBoost = true

This commit is contained in:
Anuken
2021-08-22 00:35:40 -04:00
parent f85c078de8
commit 466118319f
2 changed files with 10 additions and 2 deletions

View File

@@ -27,13 +27,14 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
@Override
public void update(){
boolean flying = isFlying();
for(int i = 0; i < 2; i++){
Trail t = i == 0 ? tleft : tright;
t.length = type.trailLength;
int sign = i == 0 ? -1 : 1;
float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y;
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid ? 1 : 0);
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid && !flying ? 1 : 0);
}
}
@@ -71,6 +72,13 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
return isFlying() ? null : EntityCollisions::waterSolid;
}
@Replace
@Override
public boolean onSolid(){
Tile tile = tileOn();
return tile == null || tile.solid() || EntityCollisions.waterSolid(tile.x, tile.y);
}
@Replace
public float floorSpeedMultiplier(){
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();