diff options
Diffstat (limited to 'src/engineapi.c')
| -rw-r--r-- | src/engineapi.c | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/engineapi.c b/src/engineapi.c index 44713da..980ee99 100644 --- a/src/engineapi.c +++ b/src/engineapi.c @@ -28,9 +28,7 @@ #include "intdefs.h" #include "langext.h" #include "mem.h" // " -#include "os.h" #include "vcall.h" -#include "x86.h" u32 _gametype_tag = 0; // declared in gametype.h but seems sensible enough here @@ -55,7 +53,9 @@ DECL_VFUNC_DYN(struct IServerGameDLL, struct ServerClass *, GetAllServerClasses) #include <gamedatainit.gen.h> // generated by build/mkgamedata.c bool engineapi_init(int pluginver) { - if_cold (!con_detect(pluginver)) return false; + // set up all these interfaces first, so con_detect can use them (currently + // it just uses engclient for OE, and arguably that usage should also be + // moved out of con_detect, but whatever, it'll do.) pluginhandler = factory_engine("ISERVERPLUGINHELPERS001", 0); if (engclient = factory_engine("VEngineClient015", 0)) { @@ -93,41 +93,9 @@ bool engineapi_init(int pluginver) { _gametype_tag |= _gametype_tag_SrvDLL005; } - // detect p1 for the benefit of specific features - if (!GAMETYPE_MATCHES(Portal2)) { - if (con_findcmd("upgrade_portalgun")) { - _gametype_tag |= _gametype_tag_Portal1; - if (!con_findvar("tf_escort_score_rate")) { - _gametype_tag |= _gametype_tag_Portal1_3420; - } - } - else if (con_findcmd("phys_swap")) { - _gametype_tag |= _gametype_tag_HL2series; - } - } - - if (GAMETYPE_MATCHES(L4D1)) { - // Crash Course update - if (con_findcmd("director_log_scavenge_items")) { - _gametype_tag |= _gametype_tag_L4D1_1015plus; - } - // seems there was some code shuffling in the Mac update (1022) - // this update came like 2-3 weeks after The Sacrifice itself released - if (con_findvar("tank_stasis_time_suicide")) { - _gametype_tag |= _gametype_tag_L4D1_1022plus; - } - } - - if (GAMETYPE_MATCHES(L4D2)) { - if (con_findvar("sv_zombie_touch_trigger_delay")) { - _gametype_tag |= _gametype_tag_L4D2_2125plus; - } - if (con_findvar("director_cs_weapon_spawn_chance")) { - _gametype_tag |= _gametype_tag_TheLastStand; - } - } + if_cold (!con_detect(pluginver)) return false; initgamedata(); - con_init(); + con_init(); // rest of console setup requires having gamedata in place if_cold (!gameinfo_init()) { con_disconnect(); return false; } return true; } |
