diff --git a/core/src/mindustry/game/Teams.java b/core/src/mindustry/game/Teams.java index e4fa1f1ef3..e4c7aa2c05 100644 --- a/core/src/mindustry/game/Teams.java +++ b/core/src/mindustry/game/Teams.java @@ -125,7 +125,7 @@ public class Teams{ } private void updateEnemies(){ - if(!active.contains(get(state.rules.waveTeam))){ + if(state.rules.waves && !active.contains(get(state.rules.waveTeam))){ active.add(get(state.rules.waveTeam)); } diff --git a/core/src/mindustry/world/BlockStorage.java b/core/src/mindustry/world/BlockStorage.java index 20c1ca8f98..338ec4526f 100644 --- a/core/src/mindustry/world/BlockStorage.java +++ b/core/src/mindustry/world/BlockStorage.java @@ -274,8 +274,7 @@ public abstract class BlockStorage extends UnlockableContent{ /** Try offloading an item to a nearby container in its facing direction. Returns true if success. */ public boolean offloadDir(Tile tile, Item item){ - Tile other = tile.getNearby(tile.rotation()); - if(other != null) other = other.link(); + Tile other = tile.front(); if(other != null && other.getTeam() == tile.getTeam() && other.block().acceptItem(item, other, tile)){ other.block().handleItem(item, other, tile); return true; diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index 591e0ac96c..bc296e2c41 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -96,7 +96,7 @@ public class Conveyor extends Block implements Autotiler{ if(tile.front() != null && tile.front().entity != null){ entity.next = tile.front().entity; - entity.nextc = entity.next instanceof ConveyorEntity ? (ConveyorEntity)entity.next : null; + entity.nextc = entity.next instanceof ConveyorEntity && entity.next.getTeam() == tile.getTeam() ? (ConveyorEntity)entity.next : null; entity.aligned = entity.nextc != null && tile.rotation() == entity.next.tile.rotation(); } } @@ -174,7 +174,7 @@ public class Conveyor extends Block implements Autotiler{ e.mid = 0; //skip updates if possible - if(e.items.total() == 0){ + if(e.len == 0){ e.clogHeat = 0f; e.sleep(); return; @@ -192,7 +192,7 @@ public class Conveyor extends Block implements Autotiler{ if(e.ys[i] > 0.5 && i > 0) e.mid = i - 1; e.xs[i] = Mathf.approachDelta(e.xs[i], 0, 0.1f); - if(e.ys[i] >= 0.9999f && offloadDir(tile, e.ids[i])){ + if(e.ys[i] >= 1f && offloadDir(tile, e.ids[i])){ //align X position if passing forwards if(e.nextc != null && e.aligned){ e.nextc.xs[e.nextc.lastInserted] = e.xs[i]; @@ -205,7 +205,7 @@ public class Conveyor extends Block implements Autotiler{ } } - if(e.minitem < itemSpace){ + if(e.minitem < itemSpace + (e.blendbits == 1 ? 0.5f : 0f)){ e.clogHeat = Mathf.lerpDelta(e.clogHeat, 1f, 0.02f); }else{ e.clogHeat = 0f; @@ -239,13 +239,14 @@ public class Conveyor extends Block implements Autotiler{ for(int i = 0; i < e.len; i++){ if(e.ids[i] == item){ e.remove(i); - e.items.remove(item, 1); removed ++; break; } } } + e.items.remove(item, removed); + return removed; } diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index d145b931f5..1ca2a6d03d 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -220,7 +220,7 @@ public class ApplicationTests{ world.loadMap(testMap); state.set(State.playing); - int length = 10; + int length = 128; world.tile(0, 0).setBlock(Blocks.itemSource); world.tile(0, 0).configureAny(Items.copper.id);