int jx = player->jx, jy = player->jy;
player->present = TRUE;
+
+ /*
if (!network_playing || player->connected)
+ */
+
+ if (!options.network || player->connected)
{
player->active = TRUE;
if (player->connected && !player->present)
{
- printf("Oops!\n");
-
-
for(j=0; j<MAX_PLAYERS; j++)
{
struct PlayerInfo *some_player = &stored_player[j];
int hi_pos;
int bumplevel = FALSE;
+ if (local_player->MovPos)
+ return;
+
local_player->LevelSolved = FALSE;
if (TimeLeft)
{
static byte stored_player_action[MAX_PLAYERS];
static int num_stored_actions = 0;
+ static boolean save_tape_entry = FALSE;
boolean moved = FALSE, snapped = FALSE, bombed = FALSE;
int jx = player->jx, jy = player->jy;
int left = player_action & JOY_LEFT;
if (player_action)
{
+ save_tape_entry = TRUE;
player->frame_reset_delay = 0;
if (button1)
stored_player_action[player->index_nr] = player_action;
+#if 0
/* this allows cycled sequences of PlayerActions() */
if (num_stored_actions >= MAX_PLAYERS)
{
TapeRecordAction(stored_player_action);
num_stored_actions = 0;
}
+#endif
+
}
else if (tape.playing && snapped)
SnapField(player, 0,0); /* stop snapping */
player->Frame = 0;
}
+ if (tape.recording && num_stored_actions >= MAX_PLAYERS && save_tape_entry)
+ {
+ TapeRecordAction(stored_player_action);
+ num_stored_actions = 0;
+ save_tape_entry = FALSE;
+ }
+
if (tape.playing && !tape.pausing && !player_action &&
tape.counter < tape.length)
{
int next_joy =
tape.pos[tape.counter].action[player->index_nr] & (JOY_LEFT|JOY_RIGHT);
- if (next_joy == JOY_LEFT || next_joy == JOY_RIGHT)
+ if ((next_joy == JOY_LEFT || next_joy == JOY_RIGHT) &&
+ (player->MovDir != JOY_UP && player->MovDir != JOY_DOWN))
{
int dx = (next_joy == JOY_LEFT ? -1 : +1);
}
+ /*
if (tape.pausing || (tape.playing && !TapePlayDelay()))
return;
else if (tape.recording)
TapeRecordDelay();
+ */
+
+ if (tape.pausing)
+ return;
+
+ if (tape.playing)
+ TapePlayDelay();
+ else if (tape.recording)
+ TapeRecordDelay();
recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
if (network_playing)
- SendToServer_MovePlayer(local_player->potential_action);
+ {
+ byte local_potential_action = 0;
+
+ for(i=0; i<MAX_PLAYERS; i++)
+ local_potential_action |= stored_player[i].potential_action;
+
+ SendToServer_MovePlayer(local_potential_action);
+ }
for(i=0; i<MAX_PLAYERS; i++)
{
ScrollScreen(NULL, SCROLL_GO_ON);
+
+ /*
+ if (tape.pausing || (tape.playing && !TapePlayDelay()))
+ return;
+ else if (tape.recording)
+ TapeRecordDelay();
+ */
+
+
FrameCounter++;
TimeFrames++;
if (!FrameReached(&player->move_delay,MoveSpeed) && !tape.playing)
return(FALSE);
+ if (player->MovPos)
+ {
+ /* should only happen if pre-1.0 tape recordings are played */
+ /* this is only for backward compatibility */
+
+#ifdef DEBUG
+ printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.0 LEVEL TAPES.\n");
+#endif
+
+ while (player->MovPos)
+ {
+ ScrollFigure(player, SCROLL_GO_ON);
+ ScrollScreen(NULL, SCROLL_GO_ON);
+ FrameCounter++;
+ DrawAllPlayers();
+ BackToFront();
+ }
+ }
+
if (player->last_move_dir & (MV_LEFT | MV_RIGHT))
{
if (!(moved |= MoveFigureOneStep(player, 0,dy, dx,dy)))