From 0a143da86037078c26735d6a1e7ac99827588b98 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Sun, 4 Jul 2010 13:12:08 +0000 Subject: [PATCH] Since time is not suspended between levels in Multiplayer, call reset_time after level change. Apply this in Singleplayer, too since it should always be safe - and appropriate - to reset timer_value soon as a new level begins --- CHANGELOG.txt | 1 + main/gameseq.c | 6 ++++-- main/multi.c | 11 +---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb576bfe0..5e6f5294f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ D2X-Rebirth Changelog SConstruct: Fixing Windows build which was not linking against SDL main/net_udp.c: Fixed Compiler-warning on Windows main/net_ipx.c, main/net_udp.c: Implemented Winsock functions for UDP which I totally forgot about; Now when leaving game in any way, close sockets and Winsock stuff +main/gameseq.c, main/multi.c: Since time is not suspended between levels in Multiplayer, call reset_time after level change. Apply this in Singleplayer, too since it should always be safe - and appropriate - to reset timer_value soon as a new level begins 20100701 -------- diff --git a/main/gameseq.c b/main/gameseq.c index 8a72baa39..c025cdd0a 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -1181,6 +1181,7 @@ void ExitSecretLevel(void) if (Game_wind) window_set_visible(Game_wind, 1); + reset_time(); } // --------------------------------------------------------------------------------------------------------------- @@ -1254,6 +1255,7 @@ void EnterSecretLevel(void) // do_cloak_invul_stuff(); if (Game_wind) window_set_visible(Game_wind, 1); + reset_time(); } //called when the player has finished a level @@ -1276,6 +1278,7 @@ void PlayerFinishedLevel(int secret_flag) if (Game_wind) window_set_visible(Game_wind, 1); + reset_time(); } #if defined(D2_OEM) || defined(COMPILATION) @@ -1565,6 +1568,7 @@ void DoPlayerDead() if (Game_wind) window_set_visible(Game_wind, 1); + reset_time(); } extern int BigWindowSwitch; @@ -1985,8 +1989,6 @@ void StartLevel(int random_flag) init_ai_objects(); #endif - // reset_time(); Time is stopped and should be resumed soon. You shall be obsolete! - reset_rear_view(); Auto_fire_fusion_cannon_time = 0; Fusion_charge = 0; diff --git a/main/multi.c b/main/multi.c index 43978eb6f..fc7dbe51c 100644 --- a/main/multi.c +++ b/main/multi.c @@ -452,7 +452,7 @@ int multi_objnum_is_past(int objnum) void multi_endlevel_score(void) { - int i, old_connect=0, old_vis = 1; + int i, old_connect=0; // Show a score list to end of net players @@ -469,20 +469,11 @@ multi_endlevel_score(void) // Do the actual screen we wish to show - if (Game_wind) - { - old_vis = window_is_visible(Game_wind); - window_set_visible(Game_wind, 0); - } - if (multi_protocol == MULTI_PROTO_IPX) kmatrix_ipx_view(Game_mode & GM_NETWORK); else kmatrix_view(Game_mode & GM_NETWORK); - if (Game_wind) - window_set_visible(Game_wind, old_vis); - // Restore connect state if (Game_mode & GM_NETWORK)