Skip to content

Commit

Permalink
Update ClientModeShared_CreateMove.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
whohyno authored Sep 20, 2024
1 parent 5180993 commit cb8fde3
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions Fusion/src/Hooks/ClientModeShared_CreateMove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,21 @@ MAKE_HOOK(ClientModeShared_CreateMove, U::Memory.GetVFunc(I::ClientModeShared, 2

I::Prediction->Update(I::ClientState->m_nDeltaTick, I::ClientState->m_nDeltaTick > 0, I::ClientState->last_command_ack, I::ClientState->lastoutgoingcommand + I::ClientState->chokedcommands);

auto pLocal = H::Entities.GetLocal();
auto pWeapon = H::Entities.GetWeapon();

G::CurrentUserCmd = pCmd;
if (!G::LastUserCmd)
if (!G::LastUserCmd) {
G::LastUserCmd = pCmd;
pLocal = I::ClientEntityList->GetClientEntity(I::EngineClient->GetLocalPlayer())->As<CTFPlayer>();
pWeapon = pLocal->m_hActiveWeapon().Get()->As<CTFWeaponBase>();
}

// correct tick_count for fakeinterp / nointerp
pCmd->tick_count += TICKS_TO_TIME(F::Backtrack.flFakeInterp) - (Vars::Visuals::Removals::Interpolation.Value ? 0 : TICKS_TO_TIME(G::Lerp));
if (G::Buttons & IN_DUCK) // lol
pCmd->buttons |= IN_DUCK;

CTFPlayer* pLocal = nullptr;
CTFWeaponBase* pWeapon = nullptr;

if (!H::Entities.GetLocal()) {
pLocal = I::ClientEntityList->GetClientEntity(I::EngineClient->GetLocalPlayer())->As<CTFPlayer>();
pWeapon = pLocal->m_hActiveWeapon().Get()->As<CTFWeaponBase>();
}
else {
pLocal = H::Entities.GetLocal();
pWeapon = H::Entities.GetWeapon();
}

if (pLocal && pWeapon)
{ // Update Global Info
int nOldDefIndex = G::WeaponDefIndex;
Expand Down

0 comments on commit cb8fde3

Please sign in to comment.