From dec2642434ad140bbfc38b8f5d992843009e9b72 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 26 Sep 2022 10:56:10 -0400 Subject: [PATCH] Fixed #7628 --- core/src/mindustry/game/Team.java | 2 +- core/src/mindustry/world/blocks/distribution/Duct.java | 2 +- core/src/mindustry/world/blocks/storage/Unloader.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index 7d0cf5b5d8..a855fea83c 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -107,7 +107,7 @@ public class Team implements Comparable{ /** @return whether this team is supposed to be AI-controlled. */ public boolean isAI(){ - return (state.rules.waves || state.rules.attackMode) && this == state.rules.waveTeam && !state.rules.pvp; + return (state.rules.waves || state.rules.attackMode) && this != state.rules.defaultTeam && !state.rules.pvp; } /** @return whether this team is solely comprised of AI (with no players possible). */ diff --git a/core/src/mindustry/world/blocks/distribution/Duct.java b/core/src/mindustry/world/blocks/distribution/Duct.java index c738270dde..3b5f0ef678 100644 --- a/core/src/mindustry/world/blocks/distribution/Duct.java +++ b/core/src/mindustry/world/blocks/distribution/Duct.java @@ -179,7 +179,7 @@ public class Duct extends Block implements Autotiler{ ((source.block.rotate && source.front() == this && source.block.hasItems && source.block.isDuct) || Edges.getFacingEdge(source.tile(), tile).relativeTo(tile) == rotation) : //standard acceptance - do not accept from front - !(source.block.rotate && next == source) && Math.abs(Edges.getFacingEdge(source.tile, tile).relativeTo(tile.x, tile.y) - rotation) != 2 + !(source.block.rotate && next == source) && Edges.getFacingEdge(source.tile, tile) != null && Math.abs(Edges.getFacingEdge(source.tile, tile).relativeTo(tile.x, tile.y) - rotation) != 2 ); } diff --git a/core/src/mindustry/world/blocks/storage/Unloader.java b/core/src/mindustry/world/blocks/storage/Unloader.java index 85b0ed8667..a707676222 100644 --- a/core/src/mindustry/world/blocks/storage/Unloader.java +++ b/core/src/mindustry/world/blocks/storage/Unloader.java @@ -89,11 +89,11 @@ public class Unloader extends Block{ //sort so it gives priority for blocks that can only either receive or give (not both), and then by load, and then by last use //highest = unload from, lowest = unload to int unloadPriority = Boolean.compare(x.canUnload && !x.canLoad, y.canUnload && !y.canLoad); //priority to receive if it cannot give - if (unloadPriority != 0) return unloadPriority; + if(unloadPriority != 0) return unloadPriority; int loadPriority = Boolean.compare(x.canUnload || !x.canLoad, y.canUnload || !y.canLoad); //priority to give if it cannot receive - if (loadPriority != 0) return loadPriority; + if(loadPriority != 0) return loadPriority; int loadFactor = Float.compare(x.loadFactor, y.loadFactor); - if (loadFactor != 0) return loadFactor; + if(loadFactor != 0) return loadFactor; return Integer.compare(y.lastUsed, x.lastUsed); //inverted };