Skip to content

Commit

Permalink
Fixed Sprint handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Krixx1337 committed Jan 29, 2025
1 parent 0e1f1c8 commit 262467a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions KX-Trainer-Free/hack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ void Hack::toggleFullStrafe(bool enable) {
void Hack::handleSprint(bool enable) {
if (enable) {
ReadMemory(m_processHandle, m_speedAddr, m_speed);
if (m_speed < SPRINT_SPEED) {

if (m_speed >= NORMAL_SPEED && m_speed < SPRINT_SPEED) {
m_speed = SPRINT_SPEED;
WriteMemory(m_processHandle, m_speedAddr, m_speed);
}
m_speedFreeze = 1;
}
else {
m_speedFreeze = 0;
m_speed = NORMAL_SPEED;
WriteMemory(m_processHandle, m_speedAddr, m_speed);
}
Expand Down
3 changes: 2 additions & 1 deletion KX-Trainer-Free/hack_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ void HackGUI::checkFullStrafe() {
void HackGUI::checkSprint() {
if (GetAsyncKeyState(KEY_SPRINT) & 1) {
m_sprintEnabled = !m_sprintEnabled;
m_hack.handleSprint(m_sprintEnabled);
std::cout << "\nSprint: " << (m_sprintEnabled ? "Enabled" : "Disabled") << std::endl;
}

m_hack.handleSprint(m_sprintEnabled);
}

void HackGUI::checkSuperSprint() {
Expand Down

0 comments on commit 262467a

Please sign in to comment.