@ -219,14 +219,14 @@ void PmChangeLightOff(Player &player)
ChangeLightOffset ( player . _plid , { x , y } ) ;
}
void WalkUp wards ( int pnum , const DirectionSettings & walkParams )
void WalkNorth wards ( int pnum , const DirectionSettings & walkParams )
{
Player & player = Players [ pnum ] ;
dPlayer [ player . position . future . x ] [ player . position . future . y ] = - ( pnum + 1 ) ;
player . position . temp = WorldTilePosition { static_cast < WorldTileCoord > ( walkParams . tileAdd . deltaX ) , static_cast < WorldTileCoord > ( walkParams . tileAdd . deltaY ) } ;
}
void WalkDown wards ( int pnum , const DirectionSettings & /*walkParams*/ )
void WalkSouth wards ( int pnum , const DirectionSettings & /*walkParams*/ )
{
Player & player = Players [ pnum ] ;
dPlayer [ player . position . tile . x ] [ player . position . tile . y ] = - ( pnum + 1 ) ;
@ -238,7 +238,7 @@ void WalkDownwards(int pnum, const DirectionSettings & /*walkParams*/)
PmChangeLightOff ( player ) ;
}
void WalkSides ( int pnum , const DirectionSettings & walkParams )
void WalkSideway s ( int pnum , const DirectionSettings & walkParams )
{
Player & player = Players [ pnum ] ;
@ -268,14 +268,14 @@ _sfx_id herosounds[enum_size<HeroClass>::value][enum_size<HeroSpeech>::value] =
constexpr std : : array < const DirectionSettings , 8 > WalkSettings { {
// clang-format off
{ Direction : : South , { 1 , 1 } , { 0 , - 32 } , { 0 , 0 } , ScrollDirection : : South , PM_WALK2 , WalkDown wards } ,
{ Direction : : SouthWest , { 0 , 1 } , { 32 , - 16 } , { 0 , 0 } , ScrollDirection : : SouthWest , PM_WALK2 , WalkDown wards } ,
{ Direction : : West , { - 1 , 1 } , { 32 , - 16 } , { 0 , 1 } , ScrollDirection : : West , PM_WALK3 , WalkSides } ,
{ Direction : : NorthWest , { - 1 , 0 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : NorthWest , PM_WALK , WalkUpwards } ,
{ Direction : : North , { - 1 , - 1 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : North , PM_WALK , WalkUpwards } ,
{ Direction : : NorthEast , { 0 , - 1 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : NorthEast , PM_WALK , WalkUpwards } ,
{ Direction : : East , { 1 , - 1 } , { - 32 , - 16 } , { 1 , 0 } , ScrollDirection : : East , PM_WALK3 , WalkSides } ,
{ Direction : : SouthEast , { 1 , 0 } , { - 32 , - 16 } , { 0 , 0 } , ScrollDirection : : SouthEast , PM_WALK2 , WalkDown wards }
{ Direction : : South , { 1 , 1 } , { 0 , - 32 } , { 0 , 0 } , ScrollDirection : : South , PM_WALK_SOUTHWARDS , WalkSouth wards } ,
{ Direction : : SouthWest , { 0 , 1 } , { 32 , - 16 } , { 0 , 0 } , ScrollDirection : : SouthWest , PM_WALK_SOUTHWARDS , WalkSouth wards } ,
{ Direction : : West , { - 1 , 1 } , { 32 , - 16 } , { 0 , 1 } , ScrollDirection : : West , PM_WALK_SIDEWAYS , WalkSideways } ,
{ Direction : : NorthWest , { - 1 , 0 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : NorthWest , PM_WALK_NORTHWARDS , WalkNorthwards } ,
{ Direction : : North , { - 1 , - 1 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : North , PM_WALK_NORTHWARDS , WalkNorthwards } ,
{ Direction : : NorthEast , { 0 , - 1 } , { 0 , 0 } , { 0 , 0 } , ScrollDirection : : NorthEast , PM_WALK_NORTHWARDS , WalkNorthwards } ,
{ Direction : : East , { 1 , - 1 } , { - 32 , - 16 } , { 1 , 0 } , ScrollDirection : : East , PM_WALK_SIDEWAYS , WalkSideways } ,
{ Direction : : SouthEast , { 1 , 0 } , { - 32 , - 16 } , { 0 , 0 } , ScrollDirection : : SouthEast , PM_WALK_SOUTHWARDS , WalkSouth wards }
// clang-format on
} } ;
@ -670,15 +670,15 @@ bool DoWalk(int pnum, int variant)
// Update the player's tile position
switch ( variant ) {
case PM_WALK :
case PM_WALK_NORTHWARDS :
dPlayer [ player . position . tile . x ] [ player . position . tile . y ] = 0 ;
player . position . tile + = { player . position . temp . x , player . position . temp . y } ;
dPlayer [ player . position . tile . x ] [ player . position . tile . y ] = pnum + 1 ;
break ;
case PM_WALK2 :
case PM_WALK_SOUTHWARDS :
dPlayer [ player . position . temp . x ] [ player . position . temp . y ] = 0 ;
break ;
case PM_WALK3 :
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.
@ -2010,7 +2010,7 @@ void Player::Stop()
bool Player : : IsWalking ( ) const
{
return IsAnyOf ( _pmode , PM_WALK , PM_WALK2 , PM_WALK3 ) ;
return IsAnyOf ( _pmode , PM_WALK_NORTHWARDS , PM_WALK_SOUTHWARDS , PM_WALK_SIDEWAYS ) ;
}
void Player : : Reset ( )
@ -3367,9 +3367,9 @@ void ProcessPlayers()
case PM_QUIT :
tplayer = false ;
break ;
case PM_WALK :
case PM_WALK2 :
case PM_WALK3 :
case PM_WALK_NORTHWARDS :
case PM_WALK_SOUTHWARDS :
case PM_WALK_SIDEWAYS :
tplayer = DoWalk ( pnum , player . _pmode ) ;
break ;
case PM_ATTACK :
@ -3570,9 +3570,9 @@ void SyncPlrAnim(Player &player)
case PM_QUIT :
graphic = player_graphic : : Stand ;
break ;
case PM_WALK :
case PM_WALK2 :
case PM_WALK3 :
case PM_WALK_NORTHWARDS :
case PM_WALK_SOUTHWARDS :
case PM_WALK_SIDEWAYS :
graphic = player_graphic : : Walk ;
break ;
case PM_ATTACK :