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:
zicodxx 2010-07-04 13:12:08 +00:00
parent 7009221170
commit 44d6e096d6
4 changed files with 7 additions and 14 deletions

View file

@ -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
--------

View file

@ -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();
}

View file

@ -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;

View file

@ -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)
{