parent
6640f52047
commit
4db305daa2
|
@ -24,8 +24,8 @@ bool globals_init(void) {
|
|||
}
|
||||
|
||||
/* Get symbol addresses using dlsym and the handler we just opened */
|
||||
gp_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs");
|
||||
gp_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs");
|
||||
i_engine = (cl_enginefunc_t*)dlsym(hw, "cl_enginefuncs");
|
||||
i_client = (cl_clientfunc_t*)dlsym(hw, "cl_funcs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
DECL_HOOK(CL_CreateMove);
|
||||
|
||||
bool hooks_init(void) {
|
||||
HOOK(gp_client, CL_CreateMove);
|
||||
HOOK(i_client, CL_CreateMove);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
||||
/* printf("Hello from CL_CreateMove!\n"); */
|
||||
/* bhop(cmd); */
|
||||
|
||||
ORIGINAL(CL_CreateMove, frametime, cmd, active);
|
||||
}
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
* DECL_INTF_EXTERN: Extern version for the header.
|
||||
*
|
||||
* prefix | meaning
|
||||
* -------+----------------
|
||||
* gp_* | global pointer
|
||||
* go_* | global original
|
||||
* -------+-------------------------------
|
||||
* i_* | interface ptr (global scope)
|
||||
* o_* | original interface (not a ptr)
|
||||
*/
|
||||
#define DECL_INTF(type, name) \
|
||||
type* gp_##name = NULL; \
|
||||
type go_##name;
|
||||
type* i_##name = NULL; \
|
||||
type o_##name;
|
||||
|
||||
#define DECL_INTF_EXTERN(type, name) \
|
||||
extern type* gp_##name; \
|
||||
extern type go_##name;
|
||||
extern type* i_##name; \
|
||||
extern type o_##name;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ __attribute__((constructor)) void load(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
gp_engine->pfnClientCmd("echo \"hl-cheat loaded successfully!\"");
|
||||
i_engine->pfnClientCmd("echo \"hl-cheat loaded successfully!\"");
|
||||
}
|
||||
|
||||
void self_unload(void) {
|
||||
|
|
Loading…
Reference in New Issue