diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 76f57f9ad9..5da29bc5c4 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -194,7 +194,7 @@ public class Logic implements ApplicationListener{ world.pathfinder.update(); } - if(!Net.client() && !world.isInvalidMap()){ + if(!Net.client() && !world.isInvalidMap() && !state.isEditor()){ checkGameOver(); } } diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 46262f56d2..2e452bc2cc 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -239,6 +239,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ } } } + player.set(world.width() * tilesize/2f, world.height() * tilesize/2f); + player.setDead(false); logic.play(); }); } diff --git a/core/src/io/anuke/mindustry/entities/type/Player.java b/core/src/io/anuke/mindustry/entities/type/Player.java index 7b2e0bf32d..780cf6d311 100644 --- a/core/src/io/anuke/mindustry/entities/type/Player.java +++ b/core/src/io/anuke/mindustry/entities/type/Player.java @@ -790,7 +790,11 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{ public void updateRespawning(){ - if(spawner != null && spawner.isValid()){ + if(state.isEditor()){ + //instant respawn at center of map. + set(world.width() * tilesize/2f, world.height() * tilesize/2f); + setDead(false); + }else if(spawner != null && spawner.isValid()){ spawner.updateSpawning(this); }else if(!netServer.isWaitingForPlayers()){ if(!Net.client()){ @@ -806,15 +810,10 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{ } public void beginRespawning(SpawnerTrait spawner){ - if(state.isEditor()){ - dead = false; - set(spawner.getX(), spawner.getY()); - }else{ - this.spawner = spawner; - this.lastSpawner = spawner; - this.dead = true; - setNet(spawner.getX(), spawner.getY()); - } + this.spawner = spawner; + this.lastSpawner = spawner; + this.dead = true; + setNet(spawner.getX(), spawner.getY()); } //endregion