- if (tape.pausing || PlayerGone)
- joy = 0;
-
- if (joy)
- {
- if (button1)
- snapped = SnapField(dx,dy);
- else
- {
- if (button2)
- bombed = PlaceBomb();
- moved = MoveFigure(dx,dy);
- }
-
- if (tape.recording && (moved || snapped || bombed))
- {
- if (bombed && !moved)
- joy &= JOY_BUTTON;
- TapeRecordAction(joy);
- }
- else if (tape.playing && snapped)
- SnapField(0,0); /* stop snapping */
- }
- else
- {
- DigField(0,0,0,0,DF_NO_PUSH);
- SnapField(0,0);
- PlayerFrame = 0;
- }
-
- if (tape.playing && !tape.pausing && !joy && tape.counter<tape.length)
- {
- int next_joy =
- tape.pos[tape.counter].joystickdata & (JOY_LEFT|JOY_RIGHT);
-
- if (next_joy == JOY_LEFT || next_joy == JOY_RIGHT)
- {
- int dx = (next_joy == JOY_LEFT ? -1 : +1);
-
- if (IN_LEV_FIELD(JX+dx,JY) && IS_PUSHABLE(Feld[JX+dx][JY]))
- {
- int el = Feld[JX+dx][JY];
- int push_delay = (IS_SB_ELEMENT(el) || el==EL_SONDE ? 2 : 10);
-
- if (tape.delay_played + push_delay >= tape.pos[tape.counter].delay)
- {
- PlayerMovDir = next_joy;
- PlayerFrame = FrameCounter % 4;
- PlayerPushing = TRUE;
- }
- }
- }
- }