Skip to content

Commit

Permalink
Fix initial ToggleSprint problem, fix attribute ids
Browse files Browse the repository at this point in the history
  • Loading branch information
marioCST committed Aug 23, 2024
1 parent 1da9f9e commit 8980b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/client/feature/module/impl/game/ToggleSprintSneak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ void ToggleSprintSneak::onTick(Event& evGeneric) {
}
else if ((std::get<BoolValue>(sprint) && toggleSprinting) || input->sprintKey) {
left = L"Sprinting";
input->sprinting = true;
if (input->front && !plr->getItemUseDuration() && !input->sneak && plr->getHunger() > 6.f) { // TODO: check CollidedHorizontally/vertically + hunger
if (!input->sprintKey) {
plr->setSprinting(true);
}
}
if (toggleSprinting) {
right = L"Toggled";
if (std::get<BoolValue>(alwaysSprint)) right = L"Always";
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/common/world/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace SDK {

class Attributes {
public:
inline static Attribute Hunger = Attribute(1, "minecraft:hunger");
inline static Attribute Saturation = Attribute(2, "minecraft:saturation");
inline static Attribute Hunger = Attribute(SDK::mvGetOffset<2, 1, 1, 1>(), "minecraft:hunger");
inline static Attribute Saturation = Attribute(SDK::mvGetOffset<3, 2, 2, 2>(), "minecraft:saturation");
inline static Attribute Health = Attribute(SDK::mvGetOffset<7, 6, 6, 6>(), "minecraft:health");
};
}

0 comments on commit 8980b3c

Please sign in to comment.