Fixed #3943
This commit is contained in:
@@ -78,7 +78,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
||||
|
||||
if(!(tile.block() instanceof ConstructBlock)){
|
||||
if(!current.initialized && !current.breaking && Build.validPlace(current.block, team, current.x, current.y, current.rotation)){
|
||||
boolean hasAll = infinite || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item));
|
||||
boolean hasAll = infinite || current.isRotation(team) || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item));
|
||||
|
||||
if(hasAll){
|
||||
Call.beginPlace(self(), current.block, team, current.x, current.y, current.rotation);
|
||||
@@ -138,7 +138,8 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
||||
/** @return whether this request should be skipped, in favor of the next one. */
|
||||
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
||||
//requests that you have at least *started* are considered
|
||||
if(state.rules.infiniteResources || team.rules().infiniteResources || request.breaking || core == null) return false;
|
||||
if(state.rules.infiniteResources || team.rules().infiniteResources || request.breaking || core == null || request.isRotation(team)) return false;
|
||||
|
||||
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item) && Mathf.round(i.amount * state.rules.buildCostMultiplier) > 0) && !request.initialized);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package mindustry.entities.units;
|
||||
import arc.func.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
@@ -61,6 +62,12 @@ public class BuildPlan implements Position{
|
||||
|
||||
}
|
||||
|
||||
public boolean isRotation(Team team){
|
||||
if(breaking) return false;
|
||||
Tile tile = tile();
|
||||
return tile != null && tile.team() == team && tile.block() == block && tile.build != null && tile.build.rotation != rotation;
|
||||
}
|
||||
|
||||
public boolean samePos(BuildPlan other){
|
||||
return x == other.x && y == other.y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user