X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=80f157012eddb293b42049a8db6e7ee26976d99d;hb=98edd2c02783d6cf8ffe4d7aec340fe80cc8bcff;hp=daf96fe52f7da0c1e22d0cfc4b6fa5539d17bd27;hpb=5ba7f2d9a3f07f342afdf215a3307d5487cb6d43;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index daf96fe5..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 */ @@ -12037,6 +12038,21 @@ static void CheckLevelTime() 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 (TimeFrames >= FRAMES_PER_SECOND) { @@ -12214,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 */ @@ -12231,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();