mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 01:37:36 +07:00
Fix Android invisible enemy bug
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.entities.enemies;
|
package io.anuke.mindustry.entities.enemies;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
@ -246,6 +245,10 @@ public class Enemy extends DestructibleEntity{
|
|||||||
}else{
|
}else{
|
||||||
idletime = 0;
|
idletime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Float.isNaN(angle)){
|
||||||
|
angle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(target == null || alwaysRotate){
|
if(target == null || alwaysRotate){
|
||||||
angle = Mathf.slerp(angle, 180f+Mathf.atan2(xvelocity, yvelocity), rotatespeed * Timers.delta());
|
angle = Mathf.slerp(angle, 180f+Mathf.atan2(xvelocity, yvelocity), rotatespeed * Timers.delta());
|
||||||
@ -256,7 +259,6 @@ public class Enemy extends DestructibleEntity{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
if(Timers.get(this, "asd", 30)) Gdx.app.error("ENEMY", "Currently drawing at " + x + " " + y);
|
|
||||||
String region = className + "-t" + Mathf.clamp(tier, 1, 3);
|
String region = className + "-t" + Mathf.clamp(tier, 1, 3);
|
||||||
|
|
||||||
Shaders.outline.color.set(tierColors[tier - 1]);
|
Shaders.outline.color.set(tierColors[tier - 1]);
|
||||||
@ -264,9 +266,8 @@ public class Enemy extends DestructibleEntity{
|
|||||||
|
|
||||||
Shaders.outline.apply();
|
Shaders.outline.apply();
|
||||||
|
|
||||||
Draw.color();
|
|
||||||
Draw.rect(region, x, y, this.angle - 90);
|
Draw.rect(region, x, y, this.angle - 90);
|
||||||
|
|
||||||
if(Vars.showPaths){
|
if(Vars.showPaths){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color(Color.PURPLE);
|
||||||
Draw.line(x, y, x + xvelocity*10f, y + yvelocity*10f);
|
Draw.line(x, y, x + xvelocity*10f, y + yvelocity*10f);
|
||||||
@ -274,7 +275,6 @@ public class Enemy extends DestructibleEntity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Graphics.flush();
|
Graphics.flush();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user