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