i fixed a null pointer exception in getLocation of job Smile

stable
mal 2023-10-20 17:39:52 -04:00
parent c4bfd44cc9
commit 4dff9566a4
1 changed files with 9 additions and 5 deletions

View File

@ -120,12 +120,16 @@ 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) {
Vector2i tile = pile.getFreeTile();
if(tile == null) continue;
return new Vector2i[] { return new Vector2i[] {
pile.getFreeTile() tile
}; };
} }
return new Vector2i[] {};
}
@Override @Override
public boolean isValid() { public boolean isValid() {