mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 22:58:47 +07:00
Fixed core-less editor gameover, respawning
This commit is contained in:
parent
7a2234cd25
commit
65ea01218a
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user