Fixed core-less editor gameover, respawning

This commit is contained in:
Anuken 2019-05-11 00:58:13 -04:00
parent 7a2234cd25
commit 65ea01218a
3 changed files with 12 additions and 11 deletions

View File

@ -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();
}
}

View File

@ -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();
});
}

View File

@ -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