Fixed units not rotating to target

This commit is contained in:
Anuken
2019-01-18 09:23:39 -05:00
parent 9c7b80f066
commit 7527f9326c
2 changed files with 4 additions and 2 deletions
@@ -14,7 +14,7 @@ import static io.anuke.mindustry.Vars.groundEffectGroup;
* Class for creating block rubble on the ground. * Class for creating block rubble on the ground.
*/ */
public abstract class Decal extends TimedEntity implements BelowLiquidTrait, DrawTrait{ public abstract class Decal extends TimedEntity implements BelowLiquidTrait, DrawTrait{
private static final Color color = Color.valueOf("2c2928"); private static final Color color = Color.valueOf("3a3635");
@Override @Override
public float lifetime(){ public float lifetime(){
@@ -265,8 +265,10 @@ public abstract class GroundUnit extends BaseUnit{
float angle = angleTo(targetTile); float angle = angleTo(targetTile);
velocity.add(vec.trns(angleTo(targetTile), type.speed*Time.delta())); velocity.add(vec.trns(angleTo(targetTile), type.speed*Time.delta()));
if(Units.invalidateTarget(target, this)){
rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed); rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed);
} }
}
protected void moveAwayFromCore(){ protected void moveAwayFromCore(){
Team enemy = null; Team enemy = null;