- /* !!! SAME CODE AS IN "CheckLevelTime()" -- FIX THIS !!! */
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
- {
- if (level.native_em_level->lev->home == 0) /* all players at home */
- {
- PlayerWins(local_player);
-
- AllPlayersGone = TRUE;
-
- level.native_em_level->lev->home = -1;
- }
-
- if (level.native_em_level->ply[0]->alive == 0 &&
- level.native_em_level->ply[1]->alive == 0 &&
- level.native_em_level->ply[2]->alive == 0 &&
- level.native_em_level->ply[3]->alive == 0) /* all dead */
- AllPlayersGone = TRUE;
- }
- else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
- {
- if (game_sp.LevelSolved &&
- !game_sp.GameOver) /* game won */
- {
- PlayerWins(local_player);
-
- game_sp.GameOver = TRUE;
-
- AllPlayersGone = TRUE;
- }
-
- if (game_sp.GameOver) /* game lost */
- AllPlayersGone = TRUE;
- }
- else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
- {
- if (game_mm.level_solved &&
- !game_mm.game_over) /* game won */
- {
- PlayerWins(local_player);
-
- game_mm.game_over = TRUE;
-
- AllPlayersGone = TRUE;
- }