Skip to content

Commit

Permalink
no need for fmax
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Feb 1, 2024
1 parent 3a2a2c3 commit 66f2062
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Hacks/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class $modify(GameStatsManager) {
class $modify(CCScheduler) {
void update(float dt) {
HackItem* speedhack = Hacks::getHack("Speedhack");
speedhack->value.floatValue = std::fmax(m_hack->value.floatValue, 0.01f);
speedhack->value.floatValue = std::max(m_hack->value.floatValue, 0.01f);
if (speedhack == nullptr) return CCScheduler::update(dt);
if (speedhack->value.floatValue == 1.0F) return CCScheduler::update(dt);
CCScheduler::update(dt * speedhack->value.floatValue);
Expand Down
4 changes: 2 additions & 2 deletions src/PrismUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void PrismUIButton::onFloatBtn(CCObject* ret) {
if (name == "Speedhack") {
if (m_hack->value.floatValue < 0.0F) return;
Hacks::setPitch(m_hack->value.floatValue);
m_hack->value.floatValue = std::fmax(m_hack->value.floatValue, 0.01f);
m_hack->value.floatValue = std::max(m_hack->value.floatValue, 0.01f);
#ifdef GEODE_IS_WINDOWS
CCDirector::sharedDirector()->getScheduler()->setTimeScale(m_hack->value.floatValue);
#endif
Expand Down Expand Up @@ -503,7 +503,7 @@ void PrismUIButton::textInputClosed(CCTextInputNode* input) { // basically onInt
input->setString(setPrecision(m_hack->value.floatValue, 3));
if (name == "Speedhack") {
if (m_hack->value.floatValue < 0.0F) return;
m_hack->value.floatValue = std::fmax(m_hack->value.floatValue, 0.01f);
m_hack->value.floatValue = std::max(m_hack->value.floatValue, 0.01f);
Hacks::setPitch(m_hack->value.floatValue);
#ifdef GEODE_IS_WINDOWS
CCDirector::sharedDirector()->getScheduler()->setTimeScale(m_hack->value.floatValue);
Expand Down

0 comments on commit 66f2062

Please sign in to comment.