mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 03:15:38 -05:00
Modify don't hook if address is nullptr
This commit is contained in:
parent
58002eaa13
commit
724a9d342b
1 changed files with 11 additions and 1 deletions
|
@ -13,6 +13,12 @@
|
|||
if constexpr (Unique::different< \
|
||||
Resolve<__VA_ARGS__>::func(&Base::FunctionName_), \
|
||||
Resolve<__VA_ARGS__>::func(&Derived::FunctionName_)>()) { \
|
||||
if (address<AddressIndex_>() == 0) { \
|
||||
log::error( \
|
||||
"Address of {} returned nullptr, can't hook", #ClassName_ "::" #FunctionName_ \
|
||||
); \
|
||||
break; \
|
||||
} \
|
||||
auto hook = Hook::create( \
|
||||
Mod::get(), \
|
||||
reinterpret_cast<void*>(address<AddressIndex_>()), \
|
||||
|
@ -106,7 +112,11 @@ namespace geode::modifier {
|
|||
class ModifyDerive {
|
||||
public:
|
||||
ModifyDerive() {
|
||||
static_assert(alwaysFalse<Derived>, "Modified class not recognized, please include <Geode/modify/ClassName.hpp> to be able to use it.");
|
||||
static_assert(
|
||||
alwaysFalse<Derived>,
|
||||
"Modified class not recognized, please include <Geode/modify/ClassName.hpp> to be "
|
||||
"able to use it."
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue