X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=f571fd1f62e9455751e79c1c80ad204f6f1f8ff8;hb=92f333709bc828c9a9ac2c162b7e52b3325bd942;hp=750c70a91e01a7ddfaeb6f63bf296c168b6bc7e9;hpb=9a1ccc76e3542f3974103e505b27fc1879f0f777;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 750c70a9..f571fd1f 100644 --- a/src/game.c +++ b/src/game.c @@ -241,6 +241,14 @@ static struct ChangingElementInfo change_delay_list[] = NULL, NULL }, + { + EL_EXIT_CLOSING, + EL_EXIT_CLOSED, + 29, + NULL, + NULL, + NULL + }, { EL_SWITCHGATE_OPENING, EL_SWITCHGATE_OPEN, @@ -1646,6 +1654,14 @@ void GameWon() StopSound(SND_GAME_LEVELTIME_BONUS); } + /* close exit door after last player */ + if (Feld[ExitX][ExitY] == EL_EXIT_OPEN && AllPlayersGone) + { + Feld[ExitX][ExitY] = EL_EXIT_CLOSING; + + PlaySoundLevelElementAction(ExitX, ExitY, EL_EXIT_OPEN, ACTION_CLOSING); + } + /* Hero disappears */ DrawLevelField(ExitX, ExitY); BackToFront(); @@ -2294,8 +2310,10 @@ void Explode(int ex, int ey, int phase, int mode) if (GfxElement[x][y] == EL_UNDEFINED) { + printf("\n\n\n"); printf("Explode(): x = %d, y = %d: GfxElement == EL_UNDEFINED\n", x, y); printf("Explode(): This should never happen!\n"); + printf("\n\n\n"); GfxElement[x][y] = EL_EMPTY; } @@ -4989,6 +5007,9 @@ void CheckExit(int x, int y) return; } + if (AllPlayersGone) /* do not re-open exit door closed after last player */ + return; + Feld[x][y] = EL_EXIT_OPENING; PlaySoundLevelNearest(x, y, SND_CLASS_EXIT_OPENING);