From c8d7588251fd4fe63ac6afe2a90ca7066c786609 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 23 Jul 2022 23:47:26 +0100 Subject: Add event system --- src/sst.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sst.c') diff --git a/src/sst.c b/src/sst.c index 4182b09..d2576f6 100644 --- a/src/sst.c +++ b/src/sst.c @@ -31,6 +31,7 @@ #include "engineapi.h" #include "errmsg.h" #include "ent.h" +#include "event.h" #include "fov.h" #include "fixes.h" #include "gameinfo.h" @@ -473,11 +474,13 @@ DECL_VFUNC_DYN(void, ServerCommand, const char *) DEF_CVAR(_sst_onload_echo, "EXPERIMENTAL! Don't rely on this existing!", "", CON_HIDDEN) +DEF_EVENT(ClientActive) + static void VCALLCONV ClientActive(void *this, struct edict *player) { // XXX: it's kind of dumb that we get handed the edict here then go look it // up again in fov.c but I can't be bothered refactoring any further now // that this finally works, do something later lol - if (has_fov) fov_onload(); + EMIT_EVENT(ClientActive) // continuing dumb portal hack. didn't even seem worth adding a feature for if (has_vtidx_ServerCommand && con_getvarstr(_sst_onload_echo)[0]) { @@ -530,4 +533,7 @@ EXPORT const void *CreateInterface(const char *name, int *ret) { return 0; } +// no better place to put this lol +#include + // vi: sw=4 ts=4 noet tw=80 cc=80 -- cgit v1.2.3