From 8c6cda0d97d2e5559614c8b7c303f426bcb821a0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 5 Jul 2018 13:38:42 -0400 Subject: [PATCH] Fixed pathfinding using water / Fixed mech factories moving too fast --- core/assets/bundles/bundle.properties | 2 +- core/src/io/anuke/mindustry/ai/Pathfinder.java | 2 +- core/src/io/anuke/mindustry/core/Control.java | 4 ++-- core/src/io/anuke/mindustry/entities/Player.java | 13 +++++++++---- .../mindustry/world/blocks/units/MechFactory.java | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index e7ce299d9d..a33590bc35 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -150,7 +150,7 @@ text.save.rename=Rename text.save.rename.text=New name: text.selectslot=Select a save. text.slot=[accent]Slot {0} -text.save.corrupted=[orange]Save file corrupted or invalid! +text.save.corrupted=[orange]Save file corrupted or invalid!\nIf you have just updated your game, this is probably a change in the save format and [scarlet]not[] a bug. text.empty= text.on=On text.off=Off diff --git a/core/src/io/anuke/mindustry/ai/Pathfinder.java b/core/src/io/anuke/mindustry/ai/Pathfinder.java index 6bbf07522e..81c6cf01c9 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfinder.java +++ b/core/src/io/anuke/mindustry/ai/Pathfinder.java @@ -84,7 +84,7 @@ public class Pathfinder { } private boolean passable(Tile tile, Team team){ - return (tile.getWallID() == 0 && tile.cliffs == 0 && !tile.floor().solid && !(tile.floor().isLiquid && (tile.floor().damageTaken > 0 || tile.floor().drownTime > 0))) + return (tile.getWallID() == 0 && !tile.floor().isLiquid && tile.cliffs == 0 && !tile.floor().solid && !(tile.floor().isLiquid && (tile.floor().damageTaken > 0 || tile.floor().drownTime > 0))) || (tile.breakable() && (tile.getTeam() != team)) || !tile.solid(); } diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 8e322d84fb..0fd0d87a66 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -314,7 +314,7 @@ public class Control extends Module{ if(!Settings.has("4.0-warning")){ Settings.putBool("4.0-warning", true); - Timers.runTask(5f, () -> { + Timers.run(5f, () -> { FloatingDialog dialog = new FloatingDialog("[orange]WARNING![]"); dialog.buttons().addButton("$text.ok", dialog::hide).size(100f, 60f); dialog.content().add("The beta version you are about to play should be considered very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " + @@ -328,7 +328,7 @@ public class Control extends Module{ if(!Settings.has("4.0-no-sound")){ Settings.putBool("4.0-no-sound", true); - Timers.runTask(4f, () -> { + Timers.run(4f, () -> { FloatingDialog dialog = new FloatingDialog("[orange]Attention![]"); dialog.buttons().addButton("$text.ok", dialog::hide).size(100f, 60f); dialog.content().add("You might have noticed that 4.0 does not have any sound.\nThis is [orange]intentional![] Sound will be added in a later update.\n\n[LIGHT_GRAY](now stop reporting this as a bug)").wrap().width(500f); diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 7c46ed1bfa..42c14c2a38 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -441,6 +441,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra boostHeat = 0f; updateRespawning(); return; + }else{ + spawner = -1; } if(!isLocal){ @@ -667,11 +669,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } public void updateRespawning(){ - CoreEntity entity = (CoreEntity)getClosestCore(); - if (entity != null) { - this.spawner = entity.tile.id(); - entity.updateSpawning(this); + if (spawner != -1 && world.tile(spawner) != null && world.tile(spawner).entity instanceof SpawnerTrait) { + ((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this); + }else{ + CoreEntity entity = (CoreEntity)getClosestCore(); + if(entity != null){ + this.spawner = entity.tile.id(); + } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/units/MechFactory.java b/core/src/io/anuke/mindustry/world/blocks/units/MechFactory.java index ab704759f9..99c54704cf 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/MechFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/MechFactory.java @@ -117,7 +117,7 @@ public class MechFactory extends Block{ entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f); entity.progress += 1f / buildTime; - entity.time += entity.heat; + entity.time += 0.5f; if(entity.progress >= 1f){ CallBlocks.onMechFactoryDone(tile);