1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 01:52:32 +01:00

Fix condition checks for being in logic update code (#5610)

This commit is contained in:
Michał Janiszewski
2017-06-14 08:44:23 +02:00
committed by Ted John
parent 3952971920
commit 9d5a86d0ae
2 changed files with 7 additions and 5 deletions

View File

@@ -345,11 +345,6 @@ void game_update()
void game_logic_update()
{
///////////////////////////
gInUpdateCode = true;
///////////////////////////
network_update();
if (network_get_mode() == NETWORK_MODE_CLIENT && network_get_status() == NETWORK_STATUS_CONNECTED && network_get_authstatus() == NETWORK_AUTH_OK) {
@@ -360,6 +355,12 @@ void game_logic_update()
}
}
///////////////////////////
// network_update() when downloaded a map will call game_init_all(), which
// leaves gInUpdateCode false. Don't call network_update() when in update code.
gInUpdateCode = true;
///////////////////////////
gScreenAge++;
if (gScreenAge == 0)
gScreenAge--;

View File

@@ -388,6 +388,7 @@ uint8 Network::GetPlayerID()
void Network::Update()
{
_closeLock = true;
assert(gInUpdateCode == false);
switch (GetMode()) {
case NETWORK_MODE_SERVER: