diff options
Diffstat (limited to 'src/sst.c')
-rw-r--r-- | src/sst.c | 28 |
1 files changed, 11 insertions, 17 deletions
@@ -170,11 +170,10 @@ static const char *updatenotes = "\ * various internal cleanup\n\ "; -#include <featureinit.gen.h> +#include <featureinit.gen.h> // generated by build/codegen.c static void do_featureinit(void) { initfeatures(); - fixes_apply(); // if we're autoloaded and the external autoupdate script downloaded a new // version, let the user know about the cool new stuff! @@ -200,25 +199,20 @@ static VGuiConnect_func orig_VGuiConnect; static void VCALLCONV hook_VGuiConnect(void *this) { orig_VGuiConnect(this); do_featureinit(); - unhook_vtable(*(void ***)vgui, vtidx_VGuiConnect, - (void *)orig_VGuiConnect); + fixes_apply(); + unhook_vtable(*(void ***)vgui, vtidx_VGuiConnect, (void *)orig_VGuiConnect); } DECL_VFUNC_DYN(bool, VGuiIsInitialized) // --- Magical deferred load order hack nonsense! --- -// The engine loads VDF plugins basically right after server.dll, but long -// before most other stuff, which makes hooking certain other stuff a pain. We -// still want to be able to load via VDF as it's the only reasonable way to get -// in before config.cfg, which is needed for any kind of configuration to work -// correctly. -// -// So here, we hook CEngineVGui::Connect() which is one the very last things -// to get called on startup, and use that hook to defer feature init till after -// most of the rest of the game is up and running. That allows us to touch -// pretty much any engine stuff without worrying about load order nonsense. +// VDF plugins load right after server.dll, but long before most other stuff. We +// want to be able to load via VDF so archived cvars in config.cfg can get set, +// but don't want to be so early that most of the game's interfaces haven't been +// brought up yet. Hook CEngineVGui::Connect(), which is called very late in +// startup, in order to init the features properly. // -// Route credit to Bill for helping figure a lot of this out - mike +// Route credit to bill for helping figure a lot of this out - mike static bool deferinit(void) { if (!vgui) { errmsg_warnx("can't use VEngineVGui for deferred feature setup"); @@ -300,7 +294,7 @@ static bool do_load(ifacefactory enginef, ifacefactory serverf) { *p++ = (void *)&nop_p_v; // OnEdictAllocated *p = (void *)&nop_p_v; // OnEdictFreed - if (!deferinit()) do_featureinit(); + if (!deferinit()) { do_featureinit(); fixes_apply(); } return true; } @@ -428,6 +422,6 @@ EXPORT const void *CreateInterface(const char *name, int *ret) { } // no better place to put this lol -#include <evglue.gen.h> +#include <evglue.gen.h> // generated by src/build/codegen.c // vi: sw=4 ts=4 noet tw=80 cc=80 |