-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
#include <Geode/DefaultInclude.hpp> | ||
|
||
#ifdef GEODE_IS_MACOS | ||
#include <Geode/loader/Mod.hpp> | ||
|
||
using namespace geode::prelude; | ||
|
||
#include <Geode/loader/Mod.hpp> | ||
#include <Geode/modify/Modify.hpp> | ||
|
||
$execute { | ||
// this replaces the call to __dynamic_cast with a call to our own | ||
// this is needed because the transitions in cocos uses dynamic cast to check | ||
// layers, which fail on user layers due to typeinfo not matching | ||
(void)Mod::get()->patch( | ||
reinterpret_cast<void*>(base::get() + 0x603948), toByteArray(&cast::typeinfoCastInternal) | ||
); | ||
} | ||
|
||
#endif | ||
#if defined(GEODE_IS_MACOS) | ||
(void)Mod::get()->patch( | ||
reinterpret_cast<void*>(base::get() + 0x603948), toByteArray(&cast::typeinfoCastInternal) | ||
); | ||
#elif defined(GEODE_IS_ANDROID) | ||
(void)Mod::get()->addHook(reinterpret_cast<void*>(base::get() + 0x519a8c), &cast::typeinfoCastInternal, "__dynamic_cast"); | ||
#endif | ||
|
||
|
||
} |