Skip to content

Commit 829b1f7

Browse files
committed
ok nvm that broke it even more
1 parent 6c2cda5 commit 829b1f7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ target_include_directories(replay-bot PRIVATE
3535
libraries/cocos-headers/extensions/
3636
)
3737

38-
# lmao
39-
option(BUILD_SHARED_LIBS "" ON)
4038
add_subdirectory(libraries/minhook)
41-
option(BUILD_SHARED_LIBS "" OFF)
4239

4340
target_link_libraries(replay-bot
4441
minhook

libraries/gd.h

src/hooks.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ auto cocos(const char* symbol) {
1313
void Hooks::init() {
1414
add_hook<&CCScheduler_update, Thiscall>(cocos("?update@CCScheduler@cocos2d@@UAEXM@Z"));
1515
add_hook<&CCKeyboardDispatcher_dispatchKeyboardMSG>(cocos("?dispatchKeyboardMSG@CCKeyboardDispatcher@cocos2d@@QAE_NW4enumKeyCodes@2@_N@Z"));
16-
add_hook<&CheckpointObject_create, Optfastcall>(gd::base + 0x20ddd0);
1716

1817
add_hook<&PlayLayer::update, Thiscall>(gd::base + 0x2029C0);
1918

20-
add_hook<&PlayLayer::resetLevel>(gd::base + 0x20BF00);
21-
2219
add_hook<&PlayLayer::pauseGame>(gd::base + 0x20D3C0);
2320

2421
add_hook<&PlayLayer::levelComplete>(gd::base + 0x1FD3D0);
@@ -85,7 +82,7 @@ void Hooks::CCKeyboardDispatcher_dispatchKeyboardMSG(CCKeyboardDispatcher* self,
8582
} else if (key == 'F') {
8683
rs.set_frame_advance(false);
8784
} else if (key == 'R') {
88-
PlayLayer::resetLevel(play_layer);
85+
play_layer->resetLevel();
8986
}
9087
}
9188
}
@@ -184,6 +181,8 @@ bool Hooks::PauseLayer_init(gd::PauseLayer* self) {
184181
// stop it breaking when loading from extensions
185182
add_hook<&PlayLayer::pushButton>(gd::base + 0x111500);
186183
add_hook<&PlayLayer::releaseButton>(gd::base + 0x111660);
184+
add_hook<&PlayLayer::resetLevel>(gd::base + 0x20BF00);
185+
add_hook<&CheckpointObject_create, Optfastcall>(gd::base + 0x20ddd0);
187186
}
188187
if (orig<&PauseLayer_init>(self)) {
189188
auto win_size = CCDirector::sharedDirector()->getWinSize();

0 commit comments

Comments
 (0)