Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: refactor walking for better responsivenes #1028

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix diagonals incorrect prewalk
nekiro committed Jan 14, 2025
commit 79644f66796c3a5755f69718456c7b45be837929
3 changes: 1 addition & 2 deletions src/client/localplayer.cpp
Original file line number Diff line number Diff line change
@@ -44,10 +44,9 @@ bool LocalPlayer::canWalk(const Otc::Direction dir, const bool ignoreLock)
if (isWalking()) {
if (isAutoWalking()) return true; // always allow automated walks
if (isPreWalking()) return false; // allow only single prewalk
return m_walkTimer.ticksElapsed() >= getStepDuration(); // allow only if walk done
}

return true;
return m_walkTimer.ticksElapsed() >= getStepDuration(); // allow only if walk done, ex. diagonals may need additional ticks before taking another step
}

void LocalPlayer::walk(const Position& oldPos, const Position& newPos)