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

Commit

Permalink
i forgot to commit this fuck
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnut committed Feb 9, 2024
1 parent 29030cb commit 1fb35e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"gd": {
"win": "2.204"
},
"version": "v2.4.5",
"version": "v2.4.6",
"id": "maxnu.gd_mega_overlay",
"name": "GD Mega Overlay",
"developer": "maxnu & SpaghettDev",
Expand Down
6 changes: 6 additions & 0 deletions src/Macrobot/Macrobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class $modify(PlayerObject)
{
void pushButton(PlayerButton btn)
{
if(playerMode == PLAYBACK && !botInput)
return;
PlayerObject::pushButton(btn);

if (GameManager::get()->getPlayLayer() && playerMode == RECORDING && gameTime != 9999999999)
Expand All @@ -140,6 +142,8 @@ class $modify(PlayerObject)

void releaseButton(PlayerButton btn)
{
if(playerMode == PLAYBACK && !botInput)
return;
PlayerObject::releaseButton(btn);

if (GameManager::get()->getPlayLayer() && playerMode == RECORDING && gameTime != 9999999999)
Expand Down Expand Up @@ -197,7 +201,9 @@ class $modify(CheckpointObject)

void Macrobot::handleAction(bool down, int button, bool player1, float timestamp)
{
botInput = true;
GameManager::get()->getPlayLayer()->handleButton(down, button, player1);
botInput = false;

bool playClicks = Settings::get<bool>("macrobot/clicks/enabled", false);

Expand Down
2 changes: 2 additions & 0 deletions src/Macrobot/Macrobot.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ namespace Macrobot
Macro() : gdr::Replay<Macro, Action>("Macrobot", "1.0") {}
};

inline bool botInput = false;

inline PlayerMode playerMode = DISABLED;

inline double gameTime = 0;
Expand Down

0 comments on commit 1fb35e2

Please sign in to comment.