summaryrefslogtreecommitdiffhomepage
path: root/src/engineapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engineapi.c')
-rw-r--r--src/engineapi.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/engineapi.c b/src/engineapi.c
index 0511c7d..d4ee742 100644
--- a/src/engineapi.c
+++ b/src/engineapi.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2023 Willian Henrique <wsimanbrazil@yahoo.com.br>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -44,8 +45,6 @@ void *inputsystem, *vgui;
DECL_VFUNC_DYN(void *, GetAllServerClasses)
-DECL_VFUNC(int, GetEngineBuildNumber_newl4d2, 99) // duping gamedata entry, yuck
-
#include <entpropsinit.gen.h>
bool engineapi_init(int pluginver) {
@@ -88,16 +87,18 @@ bool engineapi_init(int pluginver) {
// detect p1 for the benefit of specific features
if (!GAMETYPE_MATCHES(Portal2) && con_findcmd("upgrade_portalgun")) {
_gametype_tag |= _gametype_tag_Portal1;
+ if (!con_findvar("tf_arena_max_streak")) {
+ _gametype_tag |= _gametype_tag_Portal1_3420;
+ }
}
- // Ugly HACK: we want to call GetEngineBuildNumber to find out if we're on a
- // Last Stand version (because they changed entity vtables for some reason),
- // but that function also got moved in 2.0.4.1 which means we can't call it
- // till gamedata is set up, so we have to have a bit of redundant logic here
- // to bootstrap things.
- if (GAMETYPE_MATCHES(L4D2) && GAMETYPE_MATCHES(Client013) &&
- GetEngineBuildNumber_newl4d2(engclient) >= 2200) {
- _gametype_tag |= _gametype_tag_TheLastStand;
+ if (GAMETYPE_MATCHES(L4D2)) {
+ if (con_findvar("director_cs_weapon_spawn_chance")) {
+ _gametype_tag |= _gametype_tag_TheLastStand;
+ }
+ else if (con_findvar("sv_zombie_touch_trigger_delay")) {
+ _gametype_tag |= _gametype_tag_L4D2_2147;
+ }
}
// need to do this now; ServerClass network table iteration requires