diff --git a/include/g_public.h b/include/g_public.h index 91d09bbe..af27bfa3 100644 --- a/include/g_public.h +++ b/include/g_public.h @@ -189,6 +189,8 @@ typedef enum GAME_CLIENT_SAY, // ( int isTeamSay ); GAME_PAUSED_TIC, // ( int duration_msec ); // duration is in msecs GAME_CLEAR_EDICT, // (self) + + GAME_EDICT_CSQCSEND = 200, //entrypoint, called when using SendEntity } gameExport_t; typedef enum diff --git a/include/progs.h b/include/progs.h index 47ff16bf..cbdfa1d8 100644 --- a/include/progs.h +++ b/include/progs.h @@ -1235,6 +1235,10 @@ typedef struct gedict_s float healmax; // maximum health see triggers.c for defaults float healtimer; // internal timer for tracking health replenishment interval // } + +// { csqc + func_t SendEntity; +// } } gedict_t; typedef enum diff --git a/src/g_main.c b/src/g_main.c index 61eb07c1..415564fa 100644 --- a/src/g_main.c +++ b/src/g_main.c @@ -428,6 +428,17 @@ intptr_t VISIBILITY_VISIBLE vmMain( // Don't ClearGlobals() as this will be called during spawn() initialise_spawned_ent(PROG_TO_EDICT(g_globalvars.self)); + return 0; + + case GAME_EDICT_CSQCSEND: + self = PROG_TO_EDICT(g_globalvars.self); + other = PROG_TO_EDICT(g_globalvars.other); + + if (self->SendEntity) + { + return ((int(*)(int))(self->SendEntity))(arg0); + } + return 0; }