diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index a785bc91fb..0ee4ef61b5 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -303,7 +303,7 @@ public class ControlPathfinder{ if(net.client()) return; //TODO currently capped at 6 threads, might be a good idea to make it more? - threads = new PathfindThread[Mathf.clamp(Runtime.getRuntime().availableProcessors() - 2, 1, 6)]; + threads = new PathfindThread[Mathf.clamp(Runtime.getRuntime().availableProcessors() - 1, 1, 6)]; for(int i = 0; i < threads.length; i ++){ threads[i] = new PathfindThread("ControlPathfindThread-" + i); threads[i].setPriority(Thread.MIN_PRIORITY); diff --git a/core/src/mindustry/game/Schematics.java b/core/src/mindustry/game/Schematics.java index 598967608d..7b727a3122 100644 --- a/core/src/mindustry/game/Schematics.java +++ b/core/src/mindustry/game/Schematics.java @@ -352,6 +352,7 @@ public class Schematics implements Loadable{ /** Creates a schematic from a world selection. */ public Schematic create(int x, int y, int x2, int y2){ + Team team = headless ? null : Vars.player.team(); NormalizeResult result = Placement.normalizeArea(x, y, x2, y2, 0, false, maxSchematicSize); x = result.x; y = result.y; @@ -367,7 +368,7 @@ public class Schematics implements Loadable{ for(int cx = x; cx <= x2; cx++){ for(int cy = y; cy <= y2; cy++){ Building linked = world.build(cx, cy); - if(linked != null && !linked.wasVisible) continue; + if(linked != null && (!linked.isDiscovered(team) || !linked.wasVisible)) continue; Block realBlock = linked == null ? null : linked instanceof ConstructBuild cons ? cons.current : linked.block; @@ -398,6 +399,7 @@ public class Schematics implements Loadable{ for(int cx = ox; cx <= ox2; cx++){ for(int cy = oy; cy <= oy2; cy++){ Building tile = world.build(cx, cy); + if(tile != null && (!tile.isDiscovered(team) || !tile.wasVisible)) continue; Block realBlock = tile == null ? null : tile instanceof ConstructBuild cons ? cons.current : tile.block; if(tile != null && !counted.contains(tile.pos()) && realBlock != null diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 7c035caab0..67c85ca93c 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -472,6 +472,10 @@ public class UnitType extends UnlockableContent{ return spawn(state.rules.defaultTeam, pos); } + public Unit spawn(Position pos, Team team){ + return spawn(team, pos); + } + public boolean hasWeapons(){ return weapons.size > 0; } diff --git a/core/src/mindustry/world/blocks/production/HeatCrafter.java b/core/src/mindustry/world/blocks/production/HeatCrafter.java index 9c91abbfe0..66c57eb11a 100644 --- a/core/src/mindustry/world/blocks/production/HeatCrafter.java +++ b/core/src/mindustry/world/blocks/production/HeatCrafter.java @@ -8,8 +8,7 @@ import mindustry.world.blocks.heat.*; import mindustry.world.meta.*; /** A crafter that requires contact from heater blocks to craft. */ -public class -HeatCrafter extends GenericCrafter{ +public class HeatCrafter extends GenericCrafter{ /** Base heat requirement for 100% efficiency. */ public float heatRequirement = 10f; /** After heat meets this requirement, excess heat will be scaled by this number. */