diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index 332c7de701..0c5070febb 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -86,9 +86,9 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{ buildAlpha = Mathf.lerpDelta(buildAlpha, activelyBuilding() ? 1f : 0f, 0.15f); } - //validate regardless of whether building is enabled. + validatePlans(); + if(!updateBuilding || !canBuild()){ - validatePlans(); return; } @@ -99,19 +99,18 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{ if(Float.isNaN(buildCounter) || Float.isInfinite(buildCounter)) buildCounter = 0f; buildCounter = Math.min(buildCounter, 10f); + boolean instant = state.rules.instantBuild && state.rules.infiniteResources; + //random attempt to fix a freeze that only occurs on Android - int maxPerFrame = state.rules.instantBuild ? plans.size : 10, count = 0; + int maxPerFrame = instant ? plans.size : 10, count = 0; - while((buildCounter >= 1 || state.rules.instantBuild) && count++ < maxPerFrame){ + var core = core(); + + if((core == null && !infinite)) return; + + while((buildCounter >= 1 || instant) && count++ < maxPerFrame && plans.size > 0){ buildCounter -= 1f; - validatePlans(); - - var core = core(); - - //nothing to build, or core doesn't exist - if(buildPlan() == null || (core == null && !infinite)) return; - //find the next build plan if(plans.size > 1){ int total = 0; diff --git a/gradle.properties b/gradle.properties index e69588eb44..3d72e86dff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=137d14855f +archash=008e73aa33