X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=80f157012eddb293b42049a8db6e7ee26976d99d;hb=98edd2c02783d6cf8ffe4d7aec340fe80cc8bcff;hp=eb115cb3978c1e6e27da7a57d7a196f9b683b1b2;hpb=79d7ca29718d025ed0b131bf5389685fe9b941c4;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index eb115cb3..80f15701 100644 --- a/src/game.c +++ b/src/game.c @@ -12020,6 +12020,7 @@ static void CheckLevelTime() { int i; + /* !!! SAME CODE AS IN "GameActions()" -- FIX THIS !!! */ if (level.game_engine_type == GAME_ENGINE_TYPE_EM) { if (level.native_em_level->lev->home == 0) /* all players at home */ @@ -12039,10 +12040,13 @@ static void CheckLevelTime() } else if (level.game_engine_type == GAME_ENGINE_TYPE_SP) { - if (game_sp_info.LevelSolved) /* game won */ + if (game_sp_info.LevelSolved && + !game_sp_info.GameOver) /* game won */ { PlayerWins(local_player); + game_sp_info.GameOver = TRUE; + AllPlayersGone = TRUE; } @@ -12226,6 +12230,7 @@ void GameActions() if (game.restart_level) StartGameActions(options.network, setup.autorecord, level.random_seed); + /* !!! 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 */ @@ -12243,6 +12248,21 @@ void GameActions() 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_info.LevelSolved && + !game_sp_info.GameOver) /* game won */ + { + PlayerWins(local_player); + + game_sp_info.GameOver = TRUE; + + AllPlayersGone = TRUE; + } + + if (game_sp_info.GameOver) /* game lost */ + AllPlayersGone = TRUE; + } if (local_player->LevelSolved && !local_player->LevelSolved_GameEnd) GameWon();