This commit is contained in:
Anuken
2019-06-08 10:05:08 -04:00
parent ec94267b8e
commit 10bd1d1969
8 changed files with 18 additions and 9 deletions

View File

@@ -102,6 +102,8 @@ public class Units{
/** Returns the closest target enemy. First, units are checked, then tile entities. */
public static TargetTrait closestTarget(Team team, float x, float y, float range, Predicate<Unit> unitPred, Predicate<Tile> tilePred){
if(team == Team.none) return null;
Unit unit = closestEnemy(team, x, y, range, unitPred);
if(unit != null){
return unit;

View File

@@ -15,7 +15,7 @@ public class RubbleDecal extends Decal{
public static void create(float x, float y, int size){
if(headless) return;
if(regions[size].length == 0){
if(regions[size].length == 0 || regions[size][0].getTexture().isDisposed()){
regions[size] = new TextureRegion[2];
for(int j = 0; j < 2; j++){
regions[size][j] = Core.atlas.find("rubble-" + size + "-" + j);

View File

@@ -17,7 +17,7 @@ public class ScorchDecal extends Decal{
public static void create(float x, float y){
if(headless) return;
if(regions[0] == null){
if(regions[0] == null || regions[0].getTexture().isDisposed()){
for(int i = 0; i < regions.length; i++){
regions[i] = Core.atlas.find("scorch" + (i + 1));
}