Skip to content

Commit

Permalink
Added bxt_tas_clientmaxspeed_in_prediction to use lower custom maxspe…
Browse files Browse the repository at this point in the history
…ed value if cvar disabled
  • Loading branch information
SmileyAG committed Aug 9, 2022
1 parent 6df4b2d commit 17d8d8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions BunnymodXT/cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace CVars
CVarWrapper _bxt_bunnysplit_time_update_frequency("_bxt_bunnysplit_time_update_frequency", "41");
CVarWrapper _bxt_save_runtime_data_in_demos("_bxt_save_runtime_data_in_demos", "1");
CVarWrapper _bxt_tas_script_generation("_bxt_tas_script_generation", "1337");
CVarWrapper bxt_tas_clientmaxspeed_in_prediction("bxt_tas_clientmaxspeed_in_prediction", "1");
CVarWrapper bxt_taslog_filename("bxt_taslog_filename", "taslogger.log");
CVarWrapper bxt_autopause("bxt_autopause", "0");
CVarWrapper bxt_interprocess_enable("bxt_interprocess_enable", "0");
Expand Down Expand Up @@ -186,6 +187,7 @@ namespace CVars
&_bxt_norefresh,
&_bxt_save_runtime_data_in_demos,
&_bxt_tas_script_generation,
&bxt_tas_clientmaxspeed_in_prediction,
&bxt_taslog_filename,
&bxt_autopause,
&bxt_interprocess_enable,
Expand Down
1 change: 1 addition & 0 deletions BunnymodXT/cvars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ namespace CVars
extern CVarWrapper _bxt_bunnysplit_time_update_frequency;
extern CVarWrapper _bxt_save_runtime_data_in_demos;
extern CVarWrapper _bxt_tas_script_generation;
extern CVarWrapper bxt_tas_clientmaxspeed_in_prediction;
extern CVarWrapper bxt_taslog_filename;
extern CVarWrapper bxt_autopause;
extern CVarWrapper bxt_interprocess_enable;
Expand Down
5 changes: 3 additions & 2 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,7 @@ void HwDLL::RegisterCVarsAndCommandsIfNeeded()
RegisterCVar(CVars::_bxt_taslog);
RegisterCVar(CVars::_bxt_min_frametime);
RegisterCVar(CVars::_bxt_tas_script_generation);
RegisterCVar(CVars::bxt_tas_clientmaxspeed_in_prediction);
RegisterCVar(CVars::bxt_taslog_filename);
RegisterCVar(CVars::bxt_autopause);
RegisterCVar(CVars::bxt_bhopcap);
Expand Down Expand Up @@ -4751,9 +4752,9 @@ HLStrafe::MovementVars HwDLL::GetMovementVars()
vars.Frametime = GetFrameTime();
vars.Maxvelocity = CVars::sv_maxvelocity.GetFloat();

if (cl.DoesGameDirMatch("paranoia"))
if (CVars::bxt_tas_clientmaxspeed_in_prediction.GetBool() && cl.DoesGameDirMatch("paranoia"))
vars.Maxspeed = cl.pEngfuncs->GetClientMaxspeed() * 3.2f; // GetMaxSpeed is factor here, 3.2f is approx. multiplier
else if (cl.pEngfuncs && (cl.pEngfuncs->GetClientMaxspeed() > 0.0f))
else if (CVars::bxt_tas_clientmaxspeed_in_prediction.GetBool() && cl.pEngfuncs && (cl.pEngfuncs->GetClientMaxspeed() > 0.0f))
vars.Maxspeed = cl.pEngfuncs->GetClientMaxspeed(); // Get true maxspeed in CS games & other mods (Poke646 e.g.)
else
vars.Maxspeed = CVars::sv_maxspeed.GetFloat();
Expand Down

0 comments on commit 17d8d8c

Please sign in to comment.