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

View File

@ -14,7 +14,7 @@ import static io.anuke.mindustry.Vars.groundEffectGroup;
* Class for creating block rubble on the ground.
*/
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
public float lifetime(){

View File

@ -265,7 +265,9 @@ public abstract class GroundUnit extends BaseUnit{
float angle = angleTo(targetTile);
velocity.add(vec.trns(angleTo(targetTile), type.speed*Time.delta()));
rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed);
if(Units.invalidateTarget(target, this)){
rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed);
}
}
protected void moveAwayFromCore(){