mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-25 04:11:42 -04: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< \
|
if constexpr (Unique::different< \
|
||||||
Resolve<__VA_ARGS__>::func(&Base::FunctionName_), \
|
Resolve<__VA_ARGS__>::func(&Base::FunctionName_), \
|
||||||
Resolve<__VA_ARGS__>::func(&Derived::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( \
|
auto hook = Hook::create( \
|
||||||
Mod::get(), \
|
Mod::get(), \
|
||||||
reinterpret_cast<void*>(address<AddressIndex_>()), \
|
reinterpret_cast<void*>(address<AddressIndex_>()), \
|
||||||
|
@ -106,7 +112,11 @@ namespace geode::modifier {
|
||||||
class ModifyDerive {
|
class ModifyDerive {
|
||||||
public:
|
public:
|
||||||
ModifyDerive() {
|
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…
Add table
Reference in a new issue