X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=f571fd1f62e9455751e79c1c80ad204f6f1f8ff8;hb=3d61828b9abe5cf5e6cd4bd31582c46ebb25ce6f;hp=f554e6593e1c7fce11e3201751302d7d07101a6b;hpb=89a94915f3e61cb22e01622cd9cc3c1b6f4b36bb;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index f554e659..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(); @@ -2285,6 +2301,24 @@ void Explode(int ex, int ey, int phase, int mode) ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0); +#ifdef DEBUG + + /* activate this even in non-DEBUG version until cause for crash in + getGraphicAnimationFrame() (see below) is found and eliminated */ +#endif +#if 1 + + 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; + } +#endif + if (phase == first_phase_after_start) { int element = Store2[x][y]; @@ -4973,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);