summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8d141de)
This change fixes a graphical bug that occurs when the player solves a
game by entering the exit. During that last movement, the level time
in the game panel is displayed incorrectly as zero, because the final
game values for time, score etc. are calculated not before the player
has completed the last step (while the panel values are displayed from
different variables in the last stage after winning a game).
This is a fix for commit
ef1162b3.
AmoebaCnt2[group_nr]++;
}
AmoebaCnt2[group_nr]++;
}
+static void LevelSolved_SetFinalGameValues(void)
+{
+ game.time_final = (game.no_time_limit ? TimePlayed : TimeLeft);
+ game.score_time_final = (level.use_step_counter ? TimePlayed :
+ TimePlayed * FRAMES_PER_SECOND + TimeFrames);
+
+ game.score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
+ game_em.lev->score :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.score :
+ game.score);
+
+ game.health_final = (level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ MM_HEALTH(game_mm.laser_overload_value) :
+ game.health);
+
+ game.LevelSolved_CountingTime = game.time_final;
+ game.LevelSolved_CountingScore = game.score_final;
+ game.LevelSolved_CountingHealth = game.health_final;
+}
+
static void LevelSolved(void)
{
if (level.game_engine_type == GAME_ENGINE_TYPE_RND &&
static void LevelSolved(void)
{
if (level.game_engine_type == GAME_ENGINE_TYPE_RND &&
game.LevelSolved = TRUE;
game.GameOver = TRUE;
game.LevelSolved = TRUE;
game.GameOver = TRUE;
+
+ // needed here to display correct panel values while player walks into exit
+ LevelSolved_SetFinalGameValues();
if (local_player->active && local_player->MovPos)
return;
if (local_player->active && local_player->MovPos)
return;
- game.time_final = (game.no_time_limit ? TimePlayed : TimeLeft);
- game.score_time_final = (level.use_step_counter ? TimePlayed :
- TimePlayed * FRAMES_PER_SECOND + TimeFrames);
-
- game.score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
- game_em.lev->score :
- level.game_engine_type == GAME_ENGINE_TYPE_MM ?
- game_mm.score :
- game.score);
-
- game.health_final = (level.game_engine_type == GAME_ENGINE_TYPE_MM ?
- MM_HEALTH(game_mm.laser_overload_value) :
- game.health);
-
- game.LevelSolved_CountingTime = game.time_final;
- game.LevelSolved_CountingScore = game.score_final;
- game.LevelSolved_CountingHealth = game.health_final;
+ // calculate final game values after player finished walking into exit
+ LevelSolved_SetFinalGameValues();
game.LevelSolved_GameWon = TRUE;
game.LevelSolved_SaveTape = tape.recording;
game.LevelSolved_GameWon = TRUE;
game.LevelSolved_SaveTape = tape.recording;