Skip to content

Commit

Permalink
Update hlstrafe (GetPositionType hlstrafe_version 5 check)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Jan 16, 2023
1 parent a8814fc commit b52e3c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5410,7 +5410,7 @@ void HwDLL::InsertCommands()
auto playerCopy = HLStrafe::PlayerData(player); // Our copy that we will mess with.
auto traceFunc = std::bind(&HwDLL::PlayerTrace, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, false);
auto pointContentsFunc = std::bind(*(ClientDLL::GetInstance().pEngfuncs->PM_PointContents), std::placeholders::_1, nullptr);
auto postype = GetPositionType(playerCopy, traceFunc, pointContentsFunc);
auto postype = GetPositionType(playerCopy, traceFunc, pointContentsFunc, HLStrafe::MAX_SUPPORTED_VERSION);
if (ducktap && postype == HLStrafe::PositionType::GROUND) {
if (!currentKeys.Duck.IsDown() && !playerCopy.InDuckAnimation) {
// This should check against the next frame's origin but meh.
Expand All @@ -5433,15 +5433,15 @@ void HwDLL::InsertCommands()
playerCopy.InDuckAnimation = false;
playerCopy.DuckTime = 0;

auto nextPostype = HLStrafe::GetPositionType(playerCopy, traceFunc, pointContentsFunc);
auto nextPostype = HLStrafe::GetPositionType(playerCopy, traceFunc, pointContentsFunc, HLStrafe::MAX_SUPPORTED_VERSION);
if (nextPostype == HLStrafe::PositionType::GROUND) {
// Jumpbug if we're about to land.
Jump = true;
Duck = false;
}
} else {
auto vars = GetMovementVars();
auto nextPostype = HLStrafe::Move(playerCopy, vars, postype, vars.Maxspeed, traceFunc, pointContentsFunc);
auto nextPostype = HLStrafe::Move(playerCopy, vars, postype, vars.Maxspeed, traceFunc, pointContentsFunc, HLStrafe::MAX_SUPPORTED_VERSION);
if (nextPostype == HLStrafe::PositionType::GROUND) {
// Duck to prepare for the Jumpbug.
Duck = true;
Expand Down
2 changes: 1 addition & 1 deletion hlstrafe

0 comments on commit b52e3c8

Please # to comment.