fix crash on joining new server caused by last update. sorry

This commit is contained in:
nullifiedcat 2017-05-04 17:07:35 +03:00
parent c43e3dfb5d
commit 59b530b20c

View File

@ -48,7 +48,8 @@ void VMTHook::Set(ptr_t inst, uint32_t offset) {
} }
void VMTHook::Release() { void VMTHook::Release() {
if (vtable_ptr) { if (vtable_ptr && *vtable_ptr == &vtable_hooked[2]) {
logging::Info("Un-hooking 0x%08x (vtable @ 0x%08x)", vtable_ptr, *vtable_ptr);
if ((*vtable_ptr)[-1] == (method_t)GUARD) { if ((*vtable_ptr)[-1] == (method_t)GUARD) {
*vtable_ptr = vtable_original; *vtable_ptr = vtable_original;
} }