diff --git a/Source/automap.cpp b/Source/automap.cpp index abd8ea488..53ffd5a3a 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -635,7 +635,7 @@ void DrawAutomapPlr(const Surface &out, const Displacement &myPlayerOffset, int int py = tile.y - 2 * AutomapOffset.deltaY - ViewPosition.y; Displacement playerOffset = {}; - if (player.IsWalking()) + if (player.isWalking()) playerOffset = GetOffsetForWalking(player.AnimInfo, player._pdir); Point base = { @@ -887,7 +887,7 @@ void DrawAutomap(const Surface &out) const Player &myPlayer = *MyPlayer; Displacement myPlayerOffset = {}; - if (myPlayer.IsWalking()) + if (myPlayer.isWalking()) myPlayerOffset = GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true); int d = (AutoMapScale * 64) / 100; diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 04720eb80..35461b0f4 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -1314,7 +1314,7 @@ void WalkInDir(size_t playerId, AxisDirection dir) const Direction pdir = FaceDir[static_cast(dir.x)][static_cast(dir.y)]; const auto delta = player.position.future + pdir; - if (!player.IsWalking() && player.CanChangeAction()) + if (!player.isWalking() && player.CanChangeAction()) player._pdir = pdir; #ifndef USE_SDL1 diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 23f23f4e0..1ab343f42 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -297,7 +297,7 @@ void CheckCursMove() const Player &myPlayer = *MyPlayer; - if (myPlayer.IsWalking()) { + if (myPlayer.isWalking()) { Displacement offset = GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true); sx -= offset.deltaX; sy -= offset.deltaY; diff --git a/Source/engine/render/scrollrt.cpp b/Source/engine/render/scrollrt.cpp index d815fe454..9a223456d 100644 --- a/Source/engine/render/scrollrt.cpp +++ b/Source/engine/render/scrollrt.cpp @@ -729,7 +729,7 @@ void DrawMonsterHelper(const Surface &out, Point tilePosition, Point targetBuffe void DrawPlayerHelper(const Surface &out, const Player &player, Point tilePosition, Point targetBufferPosition) { Displacement offset = {}; - if (player.IsWalking()) { + if (player.isWalking()) { offset = GetOffsetForWalking(player.AnimInfo, player._pdir); } @@ -999,7 +999,7 @@ void DrawGame(const Surface &fullOut, Point position) // Adjust by player offset and tile grid alignment Player &myPlayer = *MyPlayer; Displacement offset = {}; - if (myPlayer.IsWalking()) + if (myPlayer.isWalking()) offset = GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true); int sx = offset.deltaX + tileOffset.deltaX; int sy = offset.deltaY + tileOffset.deltaY; @@ -1039,7 +1039,7 @@ void DrawGame(const Surface &fullOut, Point position) UpdateMissilesRendererData(); // Draw areas moving in and out of the screen - if (myPlayer.IsWalking()) { + if (myPlayer.isWalking()) { switch (myPlayer._pdir) { case Direction::NoDirection: break; diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 680f04cf2..3d70792fa 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -1104,7 +1104,7 @@ void SavePlayer(SaveHelper &file, const Player &player) DisplacementOf offset = {}; DisplacementOf offset2 = {}; DisplacementOf velocity = {}; - if (player.IsWalking()) { + if (player.isWalking()) { offset = player.position.CalculateWalkingOffset(player._pdir, player.AnimInfo); offset2 = player.position.CalculateWalkingOffsetShifted8(player._pdir, player.AnimInfo); velocity = player.position.GetWalkingVelocityShifted8(player._pdir, player.AnimInfo); diff --git a/Source/multi.cpp b/Source/multi.cpp index a6d82068f..9d8498b26 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -645,7 +645,7 @@ void multi_process_network_packets() FixPlrWalkTags(player); player.position.tile = syncPosition; player.position.future = syncPosition; - if (player.IsWalking()) + if (player.isWalking()) player.position.temp = syncPosition; dPlayer[player.position.tile.x][player.position.tile.y] = playerId + 1; } diff --git a/Source/player.cpp b/Source/player.cpp index 9db11a09f..8d5da2f5d 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -1932,7 +1932,7 @@ void Player::Stop() destAction = ACTION_NONE; } -bool Player::IsWalking() const +bool Player::isWalking() const { return IsAnyOf(_pmode, PM_WALK_NORTHWARDS, PM_WALK_SOUTHWARDS, PM_WALK_SIDEWAYS); } @@ -2326,7 +2326,7 @@ void NewPlrAnim(Player &player, player_graphic graphic, Direction dir, Animation int previewShownGameTickFragments = 0; if (!HeadlessMode) { sprites = player.AnimationData[static_cast(graphic)].spritesForDirection(dir); - if (player.previewCelSprite && (*sprites)[0] == *player.previewCelSprite && !player.IsWalking()) { + if (player.previewCelSprite && (*sprites)[0] == *player.previewCelSprite && !player.isWalking()) { previewShownGameTickFragments = clamp(AnimationInfo::baseValueFraction - player.progressToNextGameTickWhenPreviewWasSet, 0, AnimationInfo::baseValueFraction); } } diff --git a/Source/player.h b/Source/player.h index fb5f3060d..dbc046398 100644 --- a/Source/player.h +++ b/Source/player.h @@ -473,7 +473,7 @@ struct Player { /** * @brief Is the player currently walking? */ - bool IsWalking() const; + bool isWalking() const; /** * @brief Returns item location taking into consideration barbarian's ability to hold two-handed maces and clubs in one hand. @@ -704,7 +704,7 @@ struct Player { return true; if (_pmode == PM_SPELL && AnimInfo.currentFrame >= _pSFNum) return true; - if (IsWalking() && AnimInfo.isLastFrame()) + if (isWalking() && AnimInfo.isLastFrame()) return true; return false; } diff --git a/Source/track.cpp b/Source/track.cpp index 3c119b907..86b789ed6 100644 --- a/Source/track.cpp +++ b/Source/track.cpp @@ -23,7 +23,7 @@ void RepeatWalk(Player &player) if (!InDungeonBounds(cursPosition)) return; - if (player._pmode != PM_STAND && !(player.IsWalking() && player.AnimInfo.getFrameToUseForRendering() > 6)) + if (player._pmode != PM_STAND && !(player.isWalking() && player.AnimInfo.getFrameToUseForRendering() > 6)) return; const Point target = player.GetTargetPosition();