From acb84a61146c5f9c78a6977d23aae8c8756b100f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 20 Feb 2022 10:21:25 -0500 Subject: [PATCH] Removed pointless playerTargetFlags field --- core/src/mindustry/ai/types/FlyingAI.java | 2 +- core/src/mindustry/content/UnitTypes.java | 4 ---- core/src/mindustry/type/UnitType.java | 3 --- core/src/mindustry/world/blocks/payloads/PayloadLoader.java | 1 - 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/core/src/mindustry/ai/types/FlyingAI.java b/core/src/mindustry/ai/types/FlyingAI.java index a22a708c0d..bb4f3de78d 100644 --- a/core/src/mindustry/ai/types/FlyingAI.java +++ b/core/src/mindustry/ai/types/FlyingAI.java @@ -44,7 +44,7 @@ public class FlyingAI extends AIController{ return core; } - for(var flag : unit.team.isAI() ? unit.type.targetFlags : unit.type.playerTargetFlags){ + for(var flag : unit.type.targetFlags){ if(flag == null){ Teamc result = target(x, y, range, air, ground); if(result != null) return result; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 1908b94351..78662e8627 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -965,8 +965,6 @@ public class UnitTypes{ health = 70; engineOffset = 5.75f; targetAir = false; - //as default AI, flares are not very useful in core rushes, they attack nothing in the way - playerTargetFlags = new BlockFlag[]{null}; targetFlags = new BlockFlag[]{BlockFlag.generator, null}; hitSize = 7; itemCapacity = 15; @@ -1000,8 +998,6 @@ public class UnitTypes{ range = 140f; faceTarget = false; armor = 3f; - //do not rush core, attack closest - playerTargetFlags = new BlockFlag[]{null}; targetFlags = new BlockFlag[]{BlockFlag.factory, null}; circleTarget = true; ammoType = new ItemAmmoType(Items.graphite); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index d325ba714d..7401e3ab5c 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -107,8 +107,6 @@ public class UnitType extends UnlockableContent{ public Seq abilities = new Seq<>(); /** Flags to target based on priority. Null indicates that the closest target should be found. The closest enemy core is used as a fallback. */ public BlockFlag[] targetFlags = {null}; - /** targetFlags, as an override for "non-AI" teams. By default, units of this type will rush the core. */ - public BlockFlag[] playerTargetFlags = {BlockFlag.core, null}; /** Target items to mine. Used in MinerAI */ public Seq mineItems = Seq.with(Items.copper, Items.lead, Items.titanium, Items.thorium); @@ -116,7 +114,6 @@ public class UnitType extends UnlockableContent{ /** The default AI controller to assign on creation. */ public Prov aiController = () -> !flying ? new GroundAI() : new FlyingAI(); /** Function that chooses AI controller based on unit entity. */ - //TODO -name is too long public Func defaultController = u -> !playerControllable || (u.team.isAI() && !u.team.rules().rtsAi) ? aiController.get() : new CommandAI(); public Color outlineColor = Pal.darkerMetal; diff --git a/core/src/mindustry/world/blocks/payloads/PayloadLoader.java b/core/src/mindustry/world/blocks/payloads/PayloadLoader.java index 3fbb3c9f01..4de001e174 100644 --- a/core/src/mindustry/world/blocks/payloads/PayloadLoader.java +++ b/core/src/mindustry/world/blocks/payloads/PayloadLoader.java @@ -110,7 +110,6 @@ public class PayloadLoader extends PayloadBlock{ return liquids.current() == liquid || liquids.currentAmount() < 0.2f; } - @Override public void draw(){ Draw.rect(region, x, y);