summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-03-26 00:54:54 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2022-03-26 23:23:05 +0000
commita621e712639775c461586eb5709b4de6d74f4341 (patch)
tree828019cd6ed0fe31258bdb136955fe2425eff9c3
parent2c0d39acd0329d3e976bd83d85fcf67388465e67 (diff)
Fix L4D1 and L4DS crash regressions
Chalk this up to improper testing and being tired and not using brain.
-rw-r--r--src/gameinfo.c7
-rw-r--r--src/gametype.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gameinfo.c b/src/gameinfo.c
index 42bf3b4..31752a1 100644
--- a/src/gameinfo.c
+++ b/src/gameinfo.c
@@ -243,11 +243,14 @@ bool gameinfo_init(void *(*ifacef)(const char *, int *)) {
typedef char *(*VCALLCONV GetGameDirectory_func)(void *this);
GetGameDirectory_func **engclient;
int off;
- if (engclient = ifacef("VEngineClient014", 0)) { // bms, l4d2 2000
+ if (engclient = ifacef("VEngineClient015", 0)) { // portal 2
+ off = 35;
+ }
+ else if (engclient = ifacef("VEngineClient014", 0)) { // bms, l4d2 2000
off = 36;
}
else if (engclient = ifacef("VEngineClient013", 0)) { // ...most things?
- if (GAMETYPE_MATCHES(L4D2)) off = 36; // they changed it BACK?!?
+ if (GAMETYPE_MATCHES(L4Dx)) off = 36; // l4d2 changed it BACK?!?
else off = 35;
}
else if (engclient = ifacef("VEngineClient012", 0)) { // dmomm, ep1, ...
diff --git a/src/gametype.h b/src/gametype.h
index fbf8db2..3ad93b7 100644
--- a/src/gametype.h
+++ b/src/gametype.h
@@ -35,6 +35,7 @@ extern u32 _gametype_tag;
#define _gametype_tag_L4D (_gametype_tag_L4D1 | _gametype_tag_L4D2)
// XXX: *stupid* naming, refactor later (damn Survivors ruining everything)
#define _gametype_tag_L4D2x (_gametype_tag_L4D2 | _gametype_tag_L4DS)
+#define _gametype_tag_L4Dx (_gametype_tag_L4D1 | _gametype_tag_L4D2x)
#define _gametype_tag_L4Dbased \
(_gametype_tag_L4D1 | _gametype_tag_L4D2x | _gametype_tag_Portal2)
#define _gametype_tag_OrangeBoxbased \