From daea1f835282f27e3a6d6bde691e899616b1b4fc Mon Sep 17 00:00:00 2001 From: asmodai Date: Fri, 7 Jul 2017 01:23:58 +0300 Subject: [PATCH] Fixed crash with Half-Life game dll --- metamod/src/dllapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metamod/src/dllapi.cpp b/metamod/src/dllapi.cpp index ad3ac05..4fabf16 100644 --- a/metamod/src/dllapi.cpp +++ b/metamod/src/dllapi.cpp @@ -238,7 +238,7 @@ void compile_newdllfunc_callbacks() jitdata.post_table_offset = offsetof(MPlugin, m_newapi_post_table); for (auto& cd : g_newdllfunc_cdata) { - jitdata.pfn_original = *(size_t *)(size_t(g_GameDLL.funcs.newapi_table) + cd.offset); + jitdata.pfn_original = g_GameDLL.funcs.newapi_table ? *(size_t *)(size_t(g_GameDLL.funcs.newapi_table) + cd.offset) : 0; jitdata.args_count = cd.args_count; jitdata.has_ret = cd.has_ret; jitdata.has_varargs = cd.has_varargs;