Skip to content

Commit

Permalink
chore: style
Browse files Browse the repository at this point in the history
clang format, fix cvar name, and remove unused variable
  • Loading branch information
ThisAMJ committed Nov 27, 2023
1 parent eee79dc commit edf6a15
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/Modules/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Variable r_drawviewmodel;

Variable sar_disable_coop_score_hud("sar_disable_coop_score_hud", "0", "Disables the coop score HUD which appears in demo playback.\n");
Variable sar_disable_save_status_hud("sar_disable_save_status_hud", "0", "Disables the saving/saved HUD which appears when you make a save.\n");
Variable sar_remove_angle_decay("sar_disable_angle_decay", "0", 0, 2, "Removes angle decay.\n1 - remove small decay only.\n2 - remove angle decay entirely.\n");
Variable sar_disable_angle_decay("sar_disable_angle_decay", "0", 0, 2, "Removes angle decay.\n1 - remove small decay only.\n2 - remove angle decay entirely.\n");

REDECL(Client::LevelInitPreEntity);
REDECL(Client::CreateMove);
Expand Down Expand Up @@ -404,24 +404,16 @@ DETOUR(Client::GetButtonBits, bool bResetState) {
return bits;
}

// CInput::ApplyMouse
// C_Paint_Input::ApplyMouse
DETOUR(Client::ApplyMouse, int nSlot, QAngle &viewangles, CUserCmd *cmd, float mouse_x, float mouse_y) {

auto lastViewAngles = viewangles;

auto playerLocal = client->GetPlayer(nSlot + 1)->portal_local();

auto result = Client::ApplyMouse(thisptr, nSlot, viewangles, cmd, mouse_x, mouse_y);

if (sar_remove_angle_decay.GetBool()) {
if (
!mouse_x && !mouse_y && !viewangles.z &&
(sar_remove_angle_decay.GetInt() > 1 || fabsf(viewangles.x) < 45.0f)
) {
if (sar_disable_angle_decay.GetBool()) {
if (!mouse_x && !mouse_y && !viewangles.z && (sar_disable_angle_decay.GetInt() > 1 || fabsf(viewangles.x) < 45.0f)) {
viewangles = lastViewAngles;
}
}

return result;
}

Expand Down

0 comments on commit edf6a15

Please sign in to comment.