From 049dd894703eee297c3c59cb3bd8fa7b14840afb Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 7 Aug 2018 18:49:43 -0400 Subject: [PATCH] Fixed drone spam --- core/src/io/anuke/mindustry/ai/Pathfinder.java | 2 +- .../mindustry/maps/generation/FortressGenerator.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/ai/Pathfinder.java b/core/src/io/anuke/mindustry/ai/Pathfinder.java index 646f499d20..136930ed1b 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfinder.java +++ b/core/src/io/anuke/mindustry/ai/Pathfinder.java @@ -88,7 +88,7 @@ public class Pathfinder{ } private boolean passable(Tile tile, Team team){ - return (!tile.solid() && !(tile.floor().isLiquid && (tile.floor().damageTaken > 0 || tile.floor().drownTime > 0))) + return (!tile.solid() && !(tile.floor().isLiquid)) || (tile.breakable() && (tile.target().getTeam() != team)); } diff --git a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java index f1bbd8111d..129487e77e 100644 --- a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java @@ -5,6 +5,7 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.blocks.DefenseBlocks; import io.anuke.mindustry.content.blocks.UnitBlocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.generation.StructureFormat.StructBlock; @@ -175,11 +176,18 @@ public class FortressGenerator{ int wy = y + cy - struct.layout[0].length/2; StructBlock block = struct.layout[cx][cy]; Tile tile = world.tile(wx, wy); + + Block result = block.block; + + if(result == UnitBlocks.resupplyPoint) result = DefenseBlocks.tungstenWall; + if(result == UnitBlocks.monsoonPad) result = DefenseBlocks.tungstenWallLarge; + if(result == UnitBlocks.fabricatorPad) result = DefenseBlocks.tungstenWallLarge; + //resupply points should not be placed anymore, they confuse units - if(block.block != Blocks.air && tile.block().alwaysReplace && block.block != UnitBlocks.resupplyPoint){ + if(result != Blocks.air && tile.block().alwaysReplace){ tile.setElevation(elevation); tile.setRotation(block.rotation); - tile.setBlock(block.block, team); + tile.setBlock(result, team); fill(tile); }