diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2022-01-17 14:27:59 +0000 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2022-01-17 14:29:22 +0000 |
commit | ec365b49d7c352b0c1aad97496c915da1f0393a8 (patch) | |
tree | 453447338e50bd866ffec570476671c07b84ad35 /src/con_.c | |
parent | c0a87338a4d688517b78d26cb852c0a895a4f5b0 (diff) |
Fix Left 4 Dead 2 Survivors crashing
Diffstat (limited to 'src/con_.c')
-rw-r--r-- | src/con_.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -371,7 +371,7 @@ static void fillvts(void) { *pv++ = (void *)&InternalSetValue; *pv++ = (void *)&InternalSetFloatValue; *pv++ = (void *)&InternalSetIntValue; - if (GAMETYPE_MATCHES(L4D2) || GAMETYPE_MATCHES(Portal2)) { // ugh, annoying + if (GAMETYPE_MATCHES(L4D2x) || GAMETYPE_MATCHES(Portal2)) { // ugh, annoying // This is InternalSetColorValue, but that's basically the same thing, // when you think about it. *pv++ = (void *)&InternalSetIntValue; @@ -379,7 +379,7 @@ static void fillvts(void) { *pv++ = (void *)&ClampValue;; *pv++ = (void *)&ChangeStringValue; *pv++ = (void *)&Create_var; - if (GAMETYPE_MATCHES(L4D2) || GAMETYPE_MATCHES(Portal2)) { + if (GAMETYPE_MATCHES(L4D2x) || GAMETYPE_MATCHES(Portal2)) { *pi++ = (void *)&SetValue_colour_thunk; } #ifdef _WIN32 @@ -416,7 +416,18 @@ bool con_init(void *(*f)(const char *, int *), int plugin_ver) { if (VCALL(_con_iface, FindCommand, "l4d2_snd_adrenaline")) { _con_colourmsgf = VFUNC(_con_iface, ConsoleColorPrintf_l4d); dllid = VCALL0(_con_iface, AllocateDLLIdentifier); - _gametype_tag |= _gametype_tag_L4D2; + // while we're here, also distinguish Survivors, the stupid Japanese + // arcade game a few people seem to care about for some reason + // (which for some other reason also has some vtable changes) + if (VCALL(_con_iface, FindVar, "avatarbasemodel")) { + _gametype_tag |= _gametype_tag_L4DS; + // stupid hack: gameinfo.txt still just says Left 4 Dead 2 but + // this is _not_ Left 4 Dead 2, dammit + gameinfo_title = "Left 4 Dead: Survivors"; + } + else { + _gametype_tag |= _gametype_tag_L4D2; + } fillvts(); regcmds(VFUNC(_con_iface, RegisterConCommand)); return true; |