Multiplayer pausing as host works now

This commit is contained in:
Anuken
2022-10-31 20:24:38 -04:00
parent 6aeeb23d7c
commit b8619292d1
2 changed files with 3 additions and 5 deletions

View File

@@ -115,8 +115,6 @@ public class Vars implements Loadable{
public static final float iconXLarge = 8*6f, iconLarge = 8*5f, iconMed = 8*4f, iconSmall = 8*3f;
/** for map generator dialog */
public static boolean updateEditorOnChange = false;
/** Experimental flag for multiplayer pausing. DO NOT USE YET! */
public static boolean multiplayerPausing = false;
/** all choosable player colors in join/host dialog */
public static final Color[] playerColors = {
Color.valueOf("82759a"),

View File

@@ -52,11 +52,11 @@ public class GameState{
public void set(State astate){
//horrible horrible horrible
if(astate == State.paused && net.active() && multiplayerPausing) serverPaused = true;
if(astate != State.paused && net.active() && multiplayerPausing) serverPaused = false;
if(astate == State.paused && net.active() && !headless) serverPaused = true;
if(astate != State.paused && net.active() && !headless) serverPaused = false;
//cannot pause when in multiplayer
if(astate == State.paused && (net.active())) return;
if(astate == State.paused && net.active()) return;
Events.fire(new StateChangeEvent(state, astate));
state = astate;