Fixed bizzare crash

This commit is contained in:
Anuken 2019-11-25 18:41:09 -05:00
parent c2c5836752
commit 01304bf734

View File

@ -35,14 +35,14 @@ public interface BuilderTrait extends Entity, TeamTrait{
float finalPlaceDst = state.rules.infiniteResources ? Float.MAX_VALUE : placeDistance;
Unit unit = (Unit)this;
//remove already completed build requests
removal.clear();
removal.addAll(buildQueue());
Structs.filter(buildQueue(), req -> {
Iterator<BuildRequest> it = buildQueue().iterator();
while(it.hasNext()){
BuildRequest req = it.next();
Tile tile = world.tile(req.x, req.y);
return tile == null || (req.breaking && tile.block() == Blocks.air) || (!req.breaking && (tile.rotation() == req.rotation || !req.block.rotate) && tile.block() == req.block);
});
if(tile == null || (req.breaking && tile.block() == Blocks.air) || (!req.breaking && (tile.rotation() == req.rotation || !req.block.rotate) && tile.block() == req.block)){
it.remove();
}
}
TileEntity core = unit.getClosestCore();
@ -230,7 +230,6 @@ public interface BuilderTrait extends Entity, TeamTrait{
//due to iOS weirdness, this is apparently required
class BuildDataStatic{
static Array<BuildRequest> removal = new Array<>();
static Vector2[] tmptr = new Vector2[]{new Vector2(), new Vector2(), new Vector2(), new Vector2()};
}