diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2022-05-06 00:49:53 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2022-05-06 00:49:53 +0100 |
commit | 1ed84a25c2db8ade2b2162b429b30e9138eb5d16 (patch) | |
tree | e77be1d1c25cfed145916cb1c482c48b47a3b15d /src/engineapi.c | |
parent | cc9785e38cd1414d6d675364e5089f907b7b0a30 (diff) |
HOTFIX: Fix L4D2 2.0.0.0 crashingv0.3-HOTFIX
Idiotic problems require idiotic solutions.
Diffstat (limited to 'src/engineapi.c')
-rw-r--r-- | src/engineapi.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/engineapi.c b/src/engineapi.c index 6ba178f..5113883 100644 --- a/src/engineapi.c +++ b/src/engineapi.c @@ -22,7 +22,11 @@ #include "gametype.h" #include "intdefs.h" #include "mem.h" // " +#include "os.h" #include "vcall.h" +#include "x86.h" + +#include "con_.h" u64 _gametype_tag = 0; // declared in gametype.h but seems sensible enough here @@ -73,18 +77,17 @@ void engineapi_init(void) { _gametype_tag |= _gametype_tag_SrvDLL005; } + // TERRIBLE HACK: TODO(compat): come up with a better method later + if (GAMETYPE_MATCHES(L4D2) && os_access(OS_LIT( + "update/maps/c14m1_junkyard.bsp"), R_OK) != -1) { + _gametype_tag |= _gametype_tag_TheLastStand; + } + // need to do this now; ServerClass network table iteration requires // SendProp offsets gamedata_init(); // TODO(compat): we need this terrible hack for now because TLS somehow - // changed the entity vtable layout and I've yet to think of a way to make - // gamedata more flexible to handle that properly. I blame JAiZ. - if (engclient && has_vtidx_GetEngineBuildNumber && - VCALL(engclient, GetEngineBuildNumber) >= 2200) { - ++vtidx_Teleport; - } - if (has_vtidx_GetAllServerClasses && has_sz_SendProp && has_off_SP_varname && has_off_SP_offset) { initentprops(VCALL(srvdll, GetAllServerClasses)); |