mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Fix condition checks for being in logic update code (#5610)
This commit is contained in:
committed by
Ted John
parent
3952971920
commit
9d5a86d0ae
@@ -345,11 +345,6 @@ void game_update()
|
|||||||
|
|
||||||
void game_logic_update()
|
void game_logic_update()
|
||||||
{
|
{
|
||||||
|
|
||||||
///////////////////////////
|
|
||||||
gInUpdateCode = true;
|
|
||||||
///////////////////////////
|
|
||||||
|
|
||||||
network_update();
|
network_update();
|
||||||
|
|
||||||
if (network_get_mode() == NETWORK_MODE_CLIENT && network_get_status() == NETWORK_STATUS_CONNECTED && network_get_authstatus() == NETWORK_AUTH_OK) {
|
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++;
|
gScreenAge++;
|
||||||
if (gScreenAge == 0)
|
if (gScreenAge == 0)
|
||||||
gScreenAge--;
|
gScreenAge--;
|
||||||
|
|||||||
@@ -388,6 +388,7 @@ uint8 Network::GetPlayerID()
|
|||||||
void Network::Update()
|
void Network::Update()
|
||||||
{
|
{
|
||||||
_closeLock = true;
|
_closeLock = true;
|
||||||
|
assert(gInUpdateCode == false);
|
||||||
|
|
||||||
switch (GetMode()) {
|
switch (GetMode()) {
|
||||||
case NETWORK_MODE_SERVER:
|
case NETWORK_MODE_SERVER:
|
||||||
|
|||||||
Reference in New Issue
Block a user