geode/loader/src/hooks/DynamicCastFix.cpp
PoweredByPie 5af15fba7c Add geode::prelude to replace USE_GEODE_NAMESPACE()
Don't use macros where not necessary!
This deprecates the old macro by way of a weird alias namespace.
2023-03-10 12:09:48 -08:00

19 lines
No EOL
546 B
C++

#include <Geode/DefaultInclude.hpp>
#ifdef GEODE_IS_MACOS
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