Skip to content

Commit

Permalink
fix working with HL
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo committed Mar 15, 2024
1 parent c8f1da4 commit e987a04
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions BunnymodXT/modules/ServerDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2819,12 +2819,15 @@ HOOK_DEF_2(ServerDLL, void, __cdecl, PM_Move, struct playermove_s*, ppmove, int,
if (hw.noclip_anglehack && *hw.noclip_anglehack) {
auto new_maxspeed = CVars::bxt_ch_noclip_speed.GetFloat();

ch_noclip_vel_prev_maxspeed = *maxspeed;
ch_noclip_vel_prev_clientmaxspeed = *clientmaxspeed;

if (*clientmaxspeed == 0.0f)
*clientmaxspeed = *maxspeed;

cmd->forwardmove = cmd->forwardmove / *clientmaxspeed * new_maxspeed;
cmd->sidemove = cmd->sidemove / *clientmaxspeed * new_maxspeed;
cmd->upmove = cmd->upmove / *clientmaxspeed * new_maxspeed;

ch_noclip_vel_prev_maxspeed = *maxspeed;
ch_noclip_vel_prev_clientmaxspeed = *clientmaxspeed;
*maxspeed = *clientmaxspeed = new_maxspeed;
}

Expand Down

0 comments on commit e987a04

Please sign in to comment.