i fixed a null pointer exception in getLocation of job Smile
parent
c4bfd44cc9
commit
4dff9566a4
|
|
@ -120,11 +120,15 @@ public class Job extends GameObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2i[] getLocations() {
|
public Vector2i[] getLocations() {
|
||||||
Stockpile pile = that.get(Stockpile.class);
|
List<Stockpile> stockpiles = that.getAll(Stockpile.class);
|
||||||
// Vector4f box = pile.getWorldBox().toXYWH();
|
for(Stockpile pile : stockpiles) {
|
||||||
return new Vector2i[] {
|
Vector2i tile = pile.getFreeTile();
|
||||||
pile.getFreeTile()
|
if(tile == null) continue;
|
||||||
};
|
return new Vector2i[] {
|
||||||
|
tile
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return new Vector2i[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue