From 852ff29088e08a9f1673a070f5ff151e23e393ec Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 26 Nov 2023 19:17:43 +0000 Subject: Fix CPlugin ABI on newer L4D2 versions Thanks bill for spotting this issue. It was causing crashes on unload, which is obviously no good. --- src/engineapi.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/engineapi.h') diff --git a/src/engineapi.h b/src/engineapi.h index e95e282..44366f5 100644 --- a/src/engineapi.h +++ b/src/engineapi.h @@ -137,8 +137,7 @@ extern void *globalvars; extern void *inputsystem, *vgui; // XXX: not exactly engine *API* but not curently clear where else to put this -struct CPlugin { - char description[128]; +struct CPlugin_common { bool paused; void *theplugin; // our own "this" pointer (or whichever other plugin it is) int ifacever; @@ -146,6 +145,16 @@ struct CPlugin { // because CServerPlugin::Load() erroneously shadows this field with a local void *module; }; +struct CPlugin { + char description[128]; + union { + struct CPlugin_common v1; + struct { + char basename[128]; // WHY VALVE WHYYYYYYY!!!! + struct CPlugin_common common; + } v2; + }; +}; struct CServerPlugin /* : IServerPluginHelpers */ { void **vtable; struct CUtlVector plugins; -- cgit v1.2.3