Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
unfuck noclip accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnut committed Jan 27, 2024
1 parent a5ed903 commit 5cbe859
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions src/Hacks/Labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ class $modify(PlayLayer)

void destroyPlayer(PlayerObject* player, GameObject* object)
{
if (totalDelta > 0.1f)
dead = true;

PlayLayer::destroyPlayer(player, object);

if(frames > 60)
dead = true;
}

void resetLevel()
Expand All @@ -151,15 +151,21 @@ class $modify(PlayLayer)
totalClicks = 0;
frames = 0;
deaths = 0;
totalDelta = 0;
realDeaths = 0;
clicks.clear();
PlayLayer::resetLevel();
}

void postUpdate(float dt)
void onQuit()
{
if (labelsCreated)
labels.clear();
PlayLayer::onQuit();
}
};

void Labels::GJBaseGameLayerProcessCommands(GJBaseGameLayer *self)
{
if (labelsCreated)
{
for (Label& l : labels)
l.process();
Expand All @@ -169,9 +175,6 @@ class $modify(PlayLayer)

frames++;

if (MBO(double, GameManager::get()->getPlayLayer(), 0x583) > 0)
totalDelta += dt;

if(dead)
{
deaths++;
Expand All @@ -182,16 +185,13 @@ class $modify(PlayLayer)

lastFrameDead = dead;
dead = false;
reinterpret_cast<void(__thiscall *)(GJBaseGameLayer *)>(base::get() + 0x1BD240)(self);
}

PlayLayer::postUpdate(dt);
}

void onQuit()
{
labels.clear();
PlayLayer::onQuit();
}
};
$execute
{
Mod::get()->hook(reinterpret_cast<void *>(base::get() + 0x1BD240), &GJBaseGameLayerProcessCommands, "GJBaseGameLayer::processCommands", tulip::hook::TulipConvention::Thiscall);
}

class $modify(PlayerObject)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Hacks/Labels.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ inline size_t frames = 0;
inline size_t deaths = 0;
inline size_t realDeaths = 0;

inline float totalDelta = 0;

inline bool clickRegistered = false;
inline bool labelsCreated = false;
inline bool click = false;
Expand All @@ -47,6 +45,8 @@ Label setupLabel(const std::string& labelSettingName, const std::function<void(c

void calculatePositions();

void GJBaseGameLayerProcessCommands(GJBaseGameLayer* self);

void settingsForLabel(const std::string& labelSettingName, std::function<void()>extraSettings);
void renderWindow();
} // namespace Labels

0 comments on commit 5cbe859

Please sign in to comment.