diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index 5ae13921fa..15ea498681 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -292,7 +292,6 @@ void addBuild(BuildPlan place, boolean tail){ planSeq.clear(); } if(replace != null){ - replace.removed = true; plans.remove(replace); if(isLocalPlayer) control.input.playerPlanTree.remove(replace); } diff --git a/core/src/mindustry/entities/units/BuildPlan.java b/core/src/mindustry/entities/units/BuildPlan.java index 21d0c4edfa..57b146124c 100644 --- a/core/src/mindustry/entities/units/BuildPlan.java +++ b/core/src/mindustry/entities/units/BuildPlan.java @@ -37,8 +37,6 @@ public class BuildPlan implements Position, Pool.Poolable, QuadTreeObject{ public boolean initialized, stuck, cachedValid; /** If true, this plan is in the world. If false, it is being rendered in a schematic. */ public boolean worldContext = true; - /** Has the plan been removed from the world? */ - public boolean removed = false; /** Visual scale. Used only for rendering. */ public float animScale = 0f; diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 4870c80d38..454ebec363 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1523,7 +1523,6 @@ protected void removeSelection(int x1, int y1, int x2, int y2, boolean flush, in while(it.hasNext()){ var plan = it.next(); if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){ - plan.removed = true; it.remove(); } } @@ -1532,7 +1531,6 @@ protected void removeSelection(int x1, int y1, int x2, int y2, boolean flush, in while(it.hasNext()){ var plan = it.next(); if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){ - plan.removed = true; it.remove(); } } @@ -1541,10 +1539,7 @@ protected void removeSelection(int x1, int y1, int x2, int y2, boolean flush, in it = frozenPlans.iterator(); while (it.hasNext()) { BuildPlan plan = it.next(); - if (!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)) { - plan.removed = true; - it.remove(); - } + if (!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)) it.remove(); } } @@ -1577,7 +1572,6 @@ protected void removeSelectionPlans(int x1, int y1, int x2, int y2, int maxLengt while(it.hasNext()){ BuildPlan plan = it.next(); if(plan.bounds(Tmp.r2, true).overlaps(Tmp.r1)){ - plan.removed = true; it.remove(); } } @@ -1586,7 +1580,6 @@ protected void removeSelectionPlans(int x1, int y1, int x2, int y2, int maxLengt while(it.hasNext()){ BuildPlan plan = it.next(); if(plan.bounds(Tmp.r2, true).overlaps(Tmp.r1)){ - plan.removed = true; it.remove(); } } @@ -1595,9 +1588,7 @@ protected void removeSelectionPlans(int x1, int y1, int x2, int y2, int maxLengt it = frozenPlans.iterator(); while (it.hasNext()) { BuildPlan plan = it.next(); - if (plan.bounds(Tmp.r2, true).overlaps(Tmp.r1)) { - it.remove(); - } + if (plan.bounds(Tmp.r2, true).overlaps(Tmp.r1)) it.remove(); } } } diff --git a/core/src/mindustry/ui/fragments/PlanConfigFragment.java b/core/src/mindustry/ui/fragments/PlanConfigFragment.java index d0c95aac18..6ed5ddae0d 100644 --- a/core/src/mindustry/ui/fragments/PlanConfigFragment.java +++ b/core/src/mindustry/ui/fragments/PlanConfigFragment.java @@ -60,7 +60,8 @@ public void showConfig(BuildPlan plan) { this.hide(); return; } - if (plan.removed) { + boolean planExists = control.input.selectPlans.contains(plan) || player.unit().plans.contains(plan); + if (!planExists) { this.hide(); return; }