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
This commit is contained in:
parent
7009221170
commit
44d6e096d6
|
@ -4,6 +4,7 @@ D1X-Rebirth Changelog
|
|||
--------
|
||||
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
|
||||
--------
|
||||
|
|
|
@ -389,7 +389,7 @@ static int time_paused=0;
|
|||
void stop_time()
|
||||
{
|
||||
if (time_paused==0) {
|
||||
fix time;
|
||||
fix time;printf("STOP\n");
|
||||
time = timer_get_fixed_seconds();
|
||||
last_timer_value = time - last_timer_value;
|
||||
if (last_timer_value < 0) {
|
||||
|
@ -404,7 +404,7 @@ void start_time()
|
|||
time_paused--;
|
||||
Assert(time_paused >= 0);
|
||||
if (time_paused==0) {
|
||||
fix time;
|
||||
fix time;printf("START\n");
|
||||
time = timer_get_fixed_seconds();
|
||||
last_timer_value = time - last_timer_value;
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ void FixedStepCalc()
|
|||
}
|
||||
|
||||
void reset_time()
|
||||
{
|
||||
{printf("RESET\n");
|
||||
last_timer_value = timer_get_fixed_seconds();
|
||||
}
|
||||
|
||||
|
|
|
@ -947,6 +947,7 @@ void PlayerFinishedLevel(int secret_flag)
|
|||
|
||||
if (Game_wind)
|
||||
window_set_visible(Game_wind, 1);
|
||||
reset_time();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1139,6 +1140,7 @@ void DoPlayerDead()
|
|||
|
||||
if (Game_wind)
|
||||
window_set_visible(Game_wind, 1);
|
||||
reset_time();
|
||||
}
|
||||
|
||||
//called when the player is starting a new level for normal game mode and restore state
|
||||
|
@ -1397,7 +1399,6 @@ void StartLevel(int random)
|
|||
|
||||
ai_reset_all_paths();
|
||||
ai_init_boss_for_ship();
|
||||
// reset_time(); Time is stopped and should be resumed soon. You shall be obsolete!
|
||||
|
||||
reset_rear_view();
|
||||
Auto_fire_fusion_cannon_time = 0;
|
||||
|
|
11
main/multi.c
11
main/multi.c
|
@ -361,7 +361,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
|
||||
|
||||
|
@ -379,12 +379,6 @@ multi_endlevel_score(void)
|
|||
Network_status = NETSTAT_ENDLEVEL;
|
||||
#endif
|
||||
|
||||
if (Game_wind)
|
||||
{
|
||||
old_vis = window_is_visible(Game_wind);
|
||||
window_set_visible(Game_wind, 0);
|
||||
}
|
||||
|
||||
if (multi_protocol == MULTI_PROTO_IPX)
|
||||
{
|
||||
if (Game_mode & GM_MULTI_COOP && multi_protocol == MULTI_PROTO_IPX)
|
||||
|
@ -395,9 +389,6 @@ multi_endlevel_score(void)
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue