From 0a2d488efc6498d598b530e42e14288d858b47a2 Mon Sep 17 00:00:00 2001 From: Eric Robinson <68359262+kphoenix137@users.noreply.github.com> Date: Sun, 7 Apr 2024 07:33:35 -0400 Subject: [PATCH] Remove redundant code from southwalk fix (#7052) --- Source/player.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/Source/player.cpp b/Source/player.cpp index 8829e3377..e4d248101 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -401,7 +401,7 @@ void InitLevelChange(Player &player) /** * @brief Continue movement towards new tile */ -bool DoWalk(Player &player, int variant) +bool DoWalk(Player &player) { // Play walking sound effect on certain animation frames if (*sgOptions.Audio.walkingSound && (leveltype != DTYPE_TOWN || sgGameInitInfo.bRunInTown == 0)) { @@ -418,20 +418,10 @@ bool DoWalk(Player &player, int variant) } // We reached the new tile -> update the player's tile position - switch (variant) { - case PM_WALK_NORTHWARDS: - case PM_WALK_SOUTHWARDS: - dPlayer[player.position.tile.x][player.position.tile.y] = 0; - player.position.tile = player.position.temp; - player.occupyTile(player.position.tile, false); - break; - case PM_WALK_SIDEWAYS: - dPlayer[player.position.tile.x][player.position.tile.y] = 0; - player.position.tile = player.position.temp; - // dPlayer is set here for backwards comparability, without it the player would be invisible if loaded from a vanilla save. - player.occupyTile(player.position.tile, false); - break; - } + dPlayer[player.position.tile.x][player.position.tile.y] = 0; + player.position.tile = player.position.temp; + // dPlayer is set here for backwards compatibility; without it, the player would be invisible if loaded from a vanilla save. + player.occupyTile(player.position.tile, false); // Update the coordinates for lighting and vision entries for the player if (leveltype != DTYPE_TOWN) { @@ -3018,7 +3008,7 @@ void ProcessPlayers() case PM_WALK_NORTHWARDS: case PM_WALK_SOUTHWARDS: case PM_WALK_SIDEWAYS: - tplayer = DoWalk(player, player._pmode); + tplayer = DoWalk(player); break; case PM_ATTACK: tplayer = DoAttack(player);