diff --git a/game/game.cpp b/game/game.cpp index 3b35a1e..59e32f3 100644 --- a/game/game.cpp +++ b/game/game.cpp @@ -2687,9 +2687,4 @@ bool Game::SetVar(const char *pszName, const char *pszValue) return m_dictPvars.Set(pszName, pszValue); } -void Game::GamePause(bool fpause) { - if (!gfMultiplayer) - gsim.Pause(fpause); -} - } // namespace wi diff --git a/game/ht.h b/game/ht.h index 0c2d75f..de77e9c 100644 --- a/game/ht.h +++ b/game/ht.h @@ -2337,7 +2337,6 @@ public: bool AskObserveGame() secGame; bool CheckDatabaseVersion(const char *pszDir, char *pszPdb, bool fUpwardCompatOK) secGame; - void GamePause(bool fpause); // ModeMatch helpers diff --git a/game/sdl/host.cpp b/game/sdl/host.cpp index b17700f..0c45359 100644 --- a/game/sdl/host.cpp +++ b/game/sdl/host.cpp @@ -24,6 +24,7 @@ SurfaceProperties gprops; SDL_FingerID gtouches[2]; wi::Point gaptLast[2]; bool gfWasBackgrounded; +bool gfSimWasPaused; char *gpszUdid; @@ -402,7 +403,10 @@ bool ProcessSdlEvent(base::Message *pmsg, Event *pevt) gpdisp->SetShouldRender(true); // Unpause simulation - ggame.GamePause(false); + if (!gfSimWasPaused) { + gsim.Pause(false); + gfSimWasPaused = false; + } // The client was disconected in SDL_APP_DIDENTERBACKGROUND. // Notify the callbacks about this to present the user with a message. @@ -430,7 +434,8 @@ bool ProcessSdlEvent(base::Message *pmsg, Event *pevt) gfWasBackgrounded = true; // Pause simulation - ggame.GamePause(true); + gfSimWasPaused = gsim.IsPaused(); + gsim.Pause(true); // Close the connection to the server. If the user returns to the app, // SDL_APP_DIDENTERFOREGROUND will notify gptra's callbacks.