From 4735e28aadee62fe304aeb241ff1b1c2c7eb3984 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 25 Sep 2022 07:11:21 -0400 Subject: [PATCH] Fixed #7622 --- core/src/mindustry/ai/types/CommandAI.java | 16 +--------------- core/src/mindustry/content/Blocks.java | 3 --- core/src/mindustry/entities/comp/UnitComp.java | 2 ++ core/src/mindustry/game/Gamemode.java | 2 +- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/core/src/mindustry/ai/types/CommandAI.java b/core/src/mindustry/ai/types/CommandAI.java index c0250899af..15861014b8 100644 --- a/core/src/mindustry/ai/types/CommandAI.java +++ b/core/src/mindustry/ai/types/CommandAI.java @@ -119,21 +119,11 @@ public class CommandAI extends AIController{ } } - boolean noBoost = true; - if(targetPos != null){ boolean move = true; vecOut.set(targetPos); - //boosting units with RTS controls are incredibly buggy and hard to use. there's no clear way for units to know where to land to approach or attack something - boolean tryBoosting = false;//unit.type.canBoost && (attackTarget == null || !unit.within(attackTarget, unit.type.range)); - //noBoost = false; - - if(tryBoosting){ - unit.updateBoosting(true); - } - - if(unit.isGrounded() && !tryBoosting){ + if(unit.isGrounded()){ move = Vars.controlPath.getPathPosition(unit, pathId, targetPos, vecOut); } @@ -185,10 +175,6 @@ public class CommandAI extends AIController{ }else if(target != null){ faceTarget(); } - - if(noBoost){ - unit.updateBoosting(false); - } } @Override diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 545e0c1477..f306522c57 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -5746,7 +5746,6 @@ public class Blocks{ requirements(Category.logic, with(Items.copper, 90, Items.lead, 50, Items.silicon, 50)); instructionsPerTick = 2; - size = 1; }}; @@ -5754,9 +5753,7 @@ public class Blocks{ requirements(Category.logic, with(Items.lead, 320, Items.silicon, 80, Items.graphite, 60, Items.thorium, 50)); instructionsPerTick = 8; - range = 8 * 22; - size = 2; }}; diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index d0b2bc2679..1ce32a6867 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -64,6 +64,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I } public void updateBoosting(boolean boost){ + if(!type.canBoost) return; + elevation = Mathf.approachDelta(elevation, type.canBoost ? Mathf.num(boost || onSolid() || (isFlying() && !canLand())) : 0f, type.riseSpeed); } diff --git a/core/src/mindustry/game/Gamemode.java b/core/src/mindustry/game/Gamemode.java index 303bcc5dc9..d48bc956fd 100644 --- a/core/src/mindustry/game/Gamemode.java +++ b/core/src/mindustry/game/Gamemode.java @@ -23,7 +23,7 @@ public enum Gamemode{ rules.waveTimer = true; rules.waveSpacing = 2f * Time.toMinutes; - rules.teams.get(rules.waveTeam).infiniteResources = true; + rules.waveTeam.rules().infiniteResources = true; }, map -> map.teams.size > 1), pvp(rules -> { rules.pvp = true;