SendToServer_MovePlayer(MV_NONE);
ZX = ZY = -1;
- ExitX = ExitY = -1;
FrameCounter = 0;
TimeFrames = 0;
ScrollStepSize = 0; // will be correctly initialized by ScrollScreen()
+ game.exit_x = -1;
+ game.exit_y = -1;
+
game.all_players_gone = FALSE;
game.LevelSolved = FALSE;
if (level.game_engine_type == GAME_ENGINE_TYPE_RND)
{
- if (ExitX >= 0 && ExitY >= 0) // local player has left the level
+ // check if last player has left the level
+ if (game.exit_x >= 0 &&
+ game.exit_y >= 0)
{
+ int x = game.exit_x;
+ int y = game.exit_y;
+ int element = Feld[x][y];
+
// close exit door after last player
if ((game.all_players_gone &&
- (Feld[ExitX][ExitY] == EL_EXIT_OPEN ||
- Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN ||
- Feld[ExitX][ExitY] == EL_STEEL_EXIT_OPEN)) ||
- Feld[ExitX][ExitY] == EL_EM_EXIT_OPEN ||
- Feld[ExitX][ExitY] == EL_EM_STEEL_EXIT_OPEN)
+ (element == EL_EXIT_OPEN ||
+ element == EL_SP_EXIT_OPEN ||
+ element == EL_STEEL_EXIT_OPEN)) ||
+ element == EL_EM_EXIT_OPEN ||
+ element == EL_EM_STEEL_EXIT_OPEN)
{
- int element = Feld[ExitX][ExitY];
- Feld[ExitX][ExitY] =
+ Feld[x][y] =
(element == EL_EXIT_OPEN ? EL_EXIT_CLOSING :
element == EL_EM_EXIT_OPEN ? EL_EM_EXIT_CLOSING :
element == EL_SP_EXIT_OPEN ? EL_SP_EXIT_CLOSING:
element == EL_STEEL_EXIT_OPEN ? EL_STEEL_EXIT_CLOSING:
EL_EM_STEEL_EXIT_CLOSING);
- PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING);
+ PlayLevelSoundElementAction(x, y, element, ACTION_CLOSING);
}
// player disappears
- DrawLevelField(ExitX, ExitY);
+ DrawLevelField(x, y);
}
for (i = 0; i < MAX_PLAYERS; i++)
if (game.all_players_gone)
{
- attr_x = ExitX;
- attr_y = ExitY;
+ attr_x = game.exit_x;
+ attr_y = game.exit_y;
}
else
{
if (game.all_players_gone)
{
- attr_x = ExitX;
- attr_y = ExitY;
+ attr_x = game.exit_x;
+ attr_y = game.exit_y;
}
else
{
game.GameOver = TRUE;
}
- ExitX = ZX = jx;
- ExitY = ZY = jy;
+ game.exit_x = ZX = jx;
+ game.exit_y = ZY = jy;
}
void ExitPlayer(struct PlayerInfo *player)
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ZX));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ZY));
- SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ExitX));
- SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ExitY));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(FrameCounter));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimeFrames));
extern int BX1, BY1, BX2, BY2;
extern int SBX_Left, SBX_Right;
extern int SBY_Upper, SBY_Lower;
-extern int ZX, ZY, ExitX, ExitY;
+extern int ZX, ZY;
extern int TimeFrames, TimePlayed, TimeLeft;
extern boolean SiebAktiv;
extern int SiebCount;