diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2023-05-16 22:12:57 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2023-05-16 23:00:24 +0100 |
commit | cba9387c361c3d33dcf1b21ff0e5beb4b0a81ade (patch) | |
tree | c3b590a682447959a41c0d90f690e59b23365a3d /src/sst.c | |
parent | 182b36609acc44d3338f64ca3975e1604b50f619 (diff) |
Do some pedantic spring cleaning
- Use const in more places where it makes sense - not absolutely
everywhere because it can get a bit annoying
- Make all the instruction search loops a bit more readable by casting
the function pointer into a temporary variable to loop over
- Add a few more doc comments and fix a typo or two
- Make that RTTI thing flexibly-sized, finally
- Don't include gamedata.h in vcall.h for no reason; consequently
include gamedata.h in a bunch of places where it was implictly pulled
in before
- Fix dbg_toghidra() and ent_getedict() having mismatched return types
between their headers and respective source files
- Remove that one broken, hacky, secret Portal non-feature that probably
nobody even ended up using; it can be implemented properly later if
required
Diffstat (limited to 'src/sst.c')
-rw-r--r-- | src/sst.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -26,6 +26,7 @@ #include "errmsg.h" #include "event.h" #include "fixes.h" +#include "gamedata.h" #include "gameinfo.h" #include "gametype.h" #include "hook.h" @@ -411,13 +412,6 @@ static const char *VCALLCONV GetPluginDescription(void *this) { DECL_VFUNC_DYN(void, ServerCommand, const char *) -// XXX: quick hack requested by Portal people for some timeboxed IL grind -// challenge they want to do. I think this is a terribly sad way to do this but -// at the same time it's easy and low-impact so put it in as hidden for now -// until we come up with something better later. -DEF_CVAR(_sst_onload_echo, "EXPERIMENTAL! Don't rely on this existing!", "", - CON_HIDDEN) - DEF_EVENT(ClientActive, struct edict */*player*/) DEF_EVENT(Tick, bool /*simulating*/) @@ -429,21 +423,6 @@ static void VCALLCONV GameFrame(void *this, bool simulating) { static void VCALLCONV ClientActive(void *this, struct edict *player) { EMIT_ClientActive(player); - - // continuing dumb portal hack. didn't even seem worth adding a feature for - if (has_vtidx_ServerCommand && con_getvarstr(_sst_onload_echo)[0]) { - char *s = malloc(8 + _sst_onload_echo->strlen); // dumb lol - if (s) { // if not, game probably exploded already - memcpy(s, "echo \"", 6); - // note: assume there's no quotes in the variable, because there - // should be no way to do this at least via console - memcpy(s + 6, con_getvarstr(_sst_onload_echo), - _sst_onload_echo->strlen); - memcpy(s + 6 + _sst_onload_echo->strlen - 1, "\"\n", 3); - ServerCommand(engserver, s); - free(s); - } - } } #define MAX_VTABLE_FUNCS 21 |