From: Holger Schemel Date: Sat, 13 Oct 2012 18:10:43 +0000 (+0200) Subject: rnd-20121013-1-src X-Git-Tag: 3.3.1.0^2~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c3218c06da4da799c906a5adaacd625583f65616;p=rocksndiamonds.git rnd-20121013-1-src * fixed display of current level time when making use of time orb bug (see level set "rnd_equinox_tetrachloride_ii", level 053) --- diff --git a/ChangeLog b/ChangeLog index 2fa0f138..79cce66a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-10-13 + * fixed display of current level time when making use of time orb bug + (see level set "rnd_equinox_tetrachloride_ii", level 053) + 2011-10-07 * fixed code (esp. random/tape handling) when compiled on 64-bit systems (by simply replacing all "long" by "int" types) diff --git a/src/conftime.h b/src/conftime.h index 61e2ff61..1c9bdbb1 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2011-10-07 23:26" +#define COMPILE_DATE_STRING "2012-10-13 11:08" diff --git a/src/game.c b/src/game.c index 0a9b6185..9445ac72 100644 --- a/src/game.c +++ b/src/game.c @@ -2223,6 +2223,15 @@ void UpdatePlayfieldElementCount() void UpdateGameControlValues() { int i, k; +#if 1 + int time = (local_player->LevelSolved ? + local_player->LevelSolved_CountingTime : + level.game_engine_type == GAME_ENGINE_TYPE_EM ? + level.native_em_level->lev->time : + level.game_engine_type == GAME_ENGINE_TYPE_SP ? + level.native_sp_level->game_sp->time_played : + game.no_time_limit ? TimePlayed : TimeLeft); +#else int time = (local_player->LevelSolved ? local_player->LevelSolved_CountingTime : level.game_engine_type == GAME_ENGINE_TYPE_EM ? @@ -2230,6 +2239,7 @@ void UpdateGameControlValues() level.game_engine_type == GAME_ENGINE_TYPE_SP ? level.native_sp_level->game_sp->time_played : level.time == 0 ? TimePlayed : TimeLeft); +#endif int score = (local_player->LevelSolved ? local_player->LevelSolved_CountingScore : level.game_engine_type == GAME_ENGINE_TYPE_EM ? @@ -3180,7 +3190,7 @@ void DrawGameDoorValues() void DrawGameDoorValues_OLD() { - int time_value = (level.time == 0 ? TimePlayed : TimeLeft); + int time_value = (game.no_time_limit ? TimePlayed : TimeLeft); int dynamite_value = 0; int score_value = (local_player->LevelSolved ? local_player->score_final : local_player->score); @@ -3923,6 +3933,8 @@ void InitGame() AllPlayersGone = FALSE; + game.no_time_limit = (level.time == 0); + game.yamyam_content_nr = 0; game.robot_wheel_active = FALSE; game.magic_wall_active = FALSE; @@ -4867,7 +4879,8 @@ static void PlayerWins(struct PlayerInfo *player) player->score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->score : player->score); - player->LevelSolved_CountingTime = (level.time == 0 ? TimePlayed : TimeLeft); + player->LevelSolved_CountingTime = (game.no_time_limit ? TimePlayed : + TimeLeft); player->LevelSolved_CountingScore = player->score_final; } @@ -4913,7 +4926,7 @@ void GameWon() game_over_delay_1 = game_over_delay_value_1; game_over_delay_2 = game_over_delay_value_2; - time = time_final = (level.time == 0 ? TimePlayed : TimeLeft); + time = time_final = (game.no_time_limit ? TimePlayed : TimeLeft); score = score_final = local_player->score_final; if (TimeLeft > 0) @@ -4921,7 +4934,7 @@ void GameWon() time_final = 0; score_final += TimeLeft * level.score[SC_TIME_BONUS]; } - else if (level.time == 0 && TimePlayed < 999) + else if (game.no_time_limit && TimePlayed < 999) { time_final = 999; score_final += (999 - TimePlayed) * level.score[SC_TIME_BONUS]; @@ -12207,6 +12220,9 @@ static void CheckLevelTime() PlaySound(SND_GAME_RUNNING_OUT_OF_TIME); #if 1 + /* this does not make sense: game_panel_controls[GAME_PANEL_TIME].value + is reset from other values in UpdateGameDoorValues() -- FIX THIS */ + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; DisplayGameControlValues(); @@ -12224,19 +12240,19 @@ static void CheckLevelTime() } } #if 1 - else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + else if (game.no_time_limit && !AllPlayersGone) /* level w/o time limit */ { game_panel_controls[GAME_PANEL_TIME].value = TimePlayed; DisplayGameControlValues(); } #else - else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + else if (game.no_time_limit && !AllPlayersGone) /* level w/o time limit */ DrawGameValue_Time(TimePlayed); #endif level.native_em_level->lev->time = - (level.time == 0 ? TimePlayed : TimeLeft); + (game.no_time_limit ? TimePlayed : TimeLeft); } if (tape.recording || tape.playing) @@ -14092,14 +14108,14 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) KillPlayer(&stored_player[i]); } #if 1 - else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + else if (game.no_time_limit && !AllPlayersGone) /* level w/o time limit */ { game_panel_controls[GAME_PANEL_TIME].value = TimePlayed; DisplayGameControlValues(); } #else - else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + else if (game.no_time_limit && !AllPlayersGone) /* level w/o time limit */ DrawGameValue_Time(TimePlayed); #endif } @@ -15655,6 +15671,7 @@ static int DigField(struct PlayerInfo *player, if (level.time > 0 || level.use_time_orb_bug) { TimeLeft += level.time_orb_time; + game.no_time_limit = FALSE; #if 1 game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; @@ -16336,7 +16353,7 @@ void PlayLevelSound_SP(int xx, int yy, int element_sp, int action_sp) #if 0 void ChangeTime(int value) { - int *time = (level.time == 0 ? &TimePlayed : &TimeLeft); + int *time = (game.no_time_limit ? &TimePlayed : &TimeLeft); *time += value; diff --git a/src/game.h b/src/game.h index 96af46d0..50490be3 100644 --- a/src/game.h +++ b/src/game.h @@ -156,6 +156,7 @@ struct GameInfo boolean gravity; boolean explosions_delayed; boolean envelope_active; + boolean no_time_limit; /* (variable only in very special case) */ /* values for the new EMC elements */ int lenses_time_left;