diff --git a/src/globals.c b/src/globals.c index 4d2d330..3463f99 100644 --- a/src/globals.c +++ b/src/globals.c @@ -12,6 +12,7 @@ void** h_client; DECL_INTF(cl_enginefunc_t, engine); DECL_INTF(cl_clientfunc_t, client); DECL_INTF(playermove_t, pmove); +DECL_INTF(engine_studio_api_t, enginestudio); DECL_INTF(StudioModelRenderer_t, studiomodelrenderer); /* Updated in CL_CreateMove hook */ @@ -39,14 +40,16 @@ bool globals_init(void) { } /* Get symbol addresses using dlsym and the handler we just opened */ - i_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs"); - i_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs"); - i_pmove = *(playermove_t**)dlsym(hw, "pmove"); + i_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs"); + i_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs"); + i_pmove = *(playermove_t**)dlsym(hw, "pmove"); + i_enginestudio = (engine_studio_api_t*)dlsym(hw, "engine_studio_api"); const char* SMR_STR = "g_StudioRenderer"; /* For clang-format */ i_studiomodelrenderer = *(StudioModelRenderer_t**)dlsym(*h_client, SMR_STR); - if (!i_engine || !i_client || !i_pmove || !i_studiomodelrenderer) { + if (!i_engine || !i_client || !i_pmove || !i_enginestudio || + !i_studiomodelrenderer) { printf("hl-cheat: globals_init: couldn't load some symbols\n"); return false; } diff --git a/src/include/globals.h b/src/include/globals.h index 6b43425..aa5294a 100644 --- a/src/include/globals.h +++ b/src/include/globals.h @@ -30,6 +30,7 @@ extern void** h_client; /* hClientDLL hander */ DECL_INTF_EXTERN(cl_enginefunc_t, engine); DECL_INTF_EXTERN(cl_clientfunc_t, client); DECL_INTF_EXTERN(playermove_t, pmove); +DECL_INTF_EXTERN(engine_studio_api_t, enginestudio); DECL_INTF_EXTERN(StudioModelRenderer_t, studiomodelrenderer); extern cl_entity_t* localplayer;