Browse Source

Remove redundant code from southwalk fix (#7052)

pull/7055/head
Eric Robinson 2 years ago committed by GitHub
parent
commit
0a2d488efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      Source/player.cpp

22
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);

Loading…
Cancel
Save