+#if 0
+#if 1
+ InitPlayerGfxAnimation(player, ACTION_DEFAULT);
+#else
+ if (!(moved & MF_MOVING) && !player->is_pushing)
+ player->Frame = 0;
+#endif
+#endif
+
+ player->StepFrame = 0;
+
+ if (moved & MF_MOVING)
+ {
+ if (old_jx != jx && old_jy == jy)
+ player->MovDir = (old_jx < jx ? MV_RIGHT : MV_LEFT);
+ else if (old_jx == jx && old_jy != jy)
+ player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP);
+
+ DrawLevelField(jx, jy); /* for "crumbled sand" */
+
+ player->last_move_dir = player->MovDir;
+ player->is_moving = TRUE;
+#if 1
+ player->is_snapping = FALSE;
+#endif
+
+#if 1
+ player->is_switching = FALSE;
+#endif
+
+
+#if 1
+ {
+ static int change_sides[4][2] =
+ {
+ /* enter side leave side */
+ { CH_SIDE_RIGHT, CH_SIDE_LEFT }, /* moving left */
+ { CH_SIDE_LEFT, CH_SIDE_RIGHT }, /* moving right */
+ { CH_SIDE_BOTTOM, CH_SIDE_TOP }, /* moving up */
+ { CH_SIDE_TOP, CH_SIDE_BOTTOM } /* moving down */
+ };
+ int move_direction = player->MovDir;
+ int enter_side = change_sides[MV_DIR_BIT(move_direction)][0];
+ int leave_side = change_sides[MV_DIR_BIT(move_direction)][1];
+
+#if 1
+ if (IS_CUSTOM_ELEMENT(Feld[old_jx][old_jy]))
+ {
+ CheckTriggeredElementSideChange(old_jx, old_jy, Feld[old_jx][old_jy],
+ leave_side, CE_OTHER_GETS_LEFT);
+ CheckElementSideChange(old_jx, old_jy, Feld[old_jx][old_jy],
+ leave_side, CE_LEFT_BY_PLAYER, -1);
+ }
+
+ if (IS_CUSTOM_ELEMENT(Feld[jx][jy]))
+ {
+ CheckTriggeredElementSideChange(jx, jy, Feld[jx][jy],
+ enter_side, CE_OTHER_GETS_ENTERED);
+ CheckElementSideChange(jx, jy, Feld[jx][jy],
+ enter_side, CE_ENTERED_BY_PLAYER, -1);
+ }
+#endif
+
+ }
+#endif
+
+
+ }
+ else
+ {
+ CheckGravityMovement(player);
+
+ /*
+ player->last_move_dir = MV_NO_MOVING;
+ */
+ player->is_moving = FALSE;
+ }
+
+ if (game.engine_version < VERSION_IDENT(3,0,7,0))
+ {
+ TestIfHeroTouchesBadThing(jx, jy);
+ TestIfPlayerTouchesCustomElement(jx, jy);
+ }
+
+ if (!player->active)
+ RemoveHero(player);
+
+ return moved;
+}
+
+void ScrollPlayer(struct PlayerInfo *player, int mode)
+{
+ int jx = player->jx, jy = player->jy;
+ int last_jx = player->last_jx, last_jy = player->last_jy;
+ int move_stepsize = TILEX / player->move_delay_value;
+
+ if (!player->active || !player->MovPos)
+ return;
+
+ if (mode == SCROLL_INIT)
+ {
+ player->actual_frame_counter = FrameCounter;
+ player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
+
+ if (Feld[last_jx][last_jy] == EL_EMPTY)
+ Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
+
+#if 0
+ DrawPlayer(player);
+#endif
+ return;
+ }
+ else if (!FrameReached(&player->actual_frame_counter, 1))
+ return;
+
+ player->MovPos += (player->MovPos > 0 ? -1 : 1) * move_stepsize;
+ player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
+
+ if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING)
+ Feld[last_jx][last_jy] = EL_EMPTY;
+
+ /* before DrawPlayer() to draw correct player graphic for this case */
+ if (player->MovPos == 0)
+ CheckGravityMovement(player);
+
+#if 0
+ DrawPlayer(player); /* needed here only to cleanup last field */
+#endif
+
+ if (player->MovPos == 0) /* player reached destination field */
+ {
+ if (IS_PASSABLE(Feld[last_jx][last_jy]))
+ {
+ /* continue with normal speed after quickly moving through gate */
+ HALVE_PLAYER_SPEED(player);
+
+ /* be able to make the next move without delay */
+ player->move_delay = 0;
+ }
+
+ player->last_jx = jx;
+ player->last_jy = jy;
+
+ if (Feld[jx][jy] == EL_EXIT_OPEN ||
+ Feld[jx][jy] == EL_SP_EXIT_OPEN ||
+ Feld[jx][jy] == EL_SP_EXIT_OPENING) /* <-- special case */
+ {
+ DrawPlayer(player); /* needed here only to cleanup last field */
+ RemoveHero(player);
+
+ if (local_player->friends_still_needed == 0 ||
+ IS_SP_ELEMENT(Feld[jx][jy]))
+ player->LevelSolved = player->GameOver = TRUE;