Leg unit movement fixes

This commit is contained in:
Anuken
2020-07-12 11:34:19 -04:00
parent dad5b186db
commit f5f495b9b8
12 changed files with 63 additions and 23 deletions

View File

@@ -122,7 +122,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
this.type = type;
this.maxHealth = type.health;
this.drag = type.drag;
this.elevation = type.flying ? 1f : type.baseElevation;
this.elevation = type.flying ? 1f : 0;
this.armor = type.armor;
this.hitSize = type.hitsize;
this.hovering = type.hovering;
@@ -214,17 +214,12 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
Tile tile = tileOn();
Floor floor = floorOn();
if(tile != null && isGrounded()){
if(tile != null && isGrounded() && !type.hovering){
//unit block update
if(tile.build != null){
tile.build.unitOn(base());
}
//kill when stuck in wall
if(tile.solid()){
kill();
}
//apply damage
if(floor.damageTaken > 0f){
damageContinuous(floor.damageTaken);