Add localplayer entity
This commit is contained in:
parent
e3af8bd39a
commit
8216613d11
|
@ -10,6 +10,9 @@ DECL_INTF(cl_enginefunc_t, engine);
|
||||||
DECL_INTF(cl_clientfunc_t, client);
|
DECL_INTF(cl_clientfunc_t, client);
|
||||||
DECL_INTF(playermove_t, pmove);
|
DECL_INTF(playermove_t, pmove);
|
||||||
|
|
||||||
|
/* Updated in CL_CreateMove hook */
|
||||||
|
cl_entity_t* localplayer = NULL;
|
||||||
|
|
||||||
bool globals_init(void) {
|
bool globals_init(void) {
|
||||||
/*
|
/*
|
||||||
* Get handler for hw.so
|
* Get handler for hw.so
|
||||||
|
|
|
@ -16,5 +16,13 @@ bool hooks_init(void) {
|
||||||
void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
||||||
ORIGINAL(CL_CreateMove, frametime, cmd, active);
|
ORIGINAL(CL_CreateMove, frametime, cmd, active);
|
||||||
|
|
||||||
|
/* Declared in globals.c */
|
||||||
|
localplayer = i_engine->GetLocalPlayer();
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("x: %f, y: %f, z: %f\n", localplayer->origin[0],
|
||||||
|
localplayer->origin[1], localplayer->origin[2]);
|
||||||
|
#endif
|
||||||
|
|
||||||
bhop(cmd);
|
bhop(cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ DECL_INTF_EXTERN(cl_enginefunc_t, engine);
|
||||||
DECL_INTF_EXTERN(cl_clientfunc_t, client);
|
DECL_INTF_EXTERN(cl_clientfunc_t, client);
|
||||||
DECL_INTF_EXTERN(playermove_t, pmove);
|
DECL_INTF_EXTERN(playermove_t, pmove);
|
||||||
|
|
||||||
|
extern cl_entity_t* localplayer;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
bool globals_init(void);
|
bool globals_init(void);
|
||||||
|
|
Loading…
Reference in New Issue