File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ void Hooks::init() {
1717
1818 add_hook<&PlayLayer::update, Thiscall>(gd::base + 0x2029C0 );
1919
20- add_hook<&PlayLayer::pushButton>(gd::base + 0x111500 );
21- add_hook<&PlayLayer::releaseButton>(gd::base + 0x111660 );
2220 add_hook<&PlayLayer::resetLevel>(gd::base + 0x20BF00 );
2321
2422 add_hook<&PlayLayer::pauseGame>(gd::base + 0x20D3C0 );
@@ -179,6 +177,14 @@ void Hooks::PauseLayer_onEditor(gd::PauseLayer* self, CCObject* idk) {
179177}
180178
181179bool Hooks::PauseLayer_init (gd::PauseLayer* self) {
180+ static bool placed_hooks = false ;
181+ if (!placed_hooks) {
182+ placed_hooks = true ;
183+ // this is stupid lol, but should hopefully
184+ // stop it breaking when loading from extensions
185+ add_hook<&PlayLayer::pushButton>(gd::base + 0x111500 );
186+ add_hook<&PlayLayer::releaseButton>(gd::base + 0x111660 );
187+ }
182188 if (orig<&PauseLayer_init>(self)) {
183189 auto win_size = CCDirector::sharedDirector ()->getWinSize ();
184190
You can’t perform that action at this time.
0 commit comments