Skip to content

Commit

Permalink
make is_cstrike_dir better
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo committed Jul 11, 2024
1 parent af8b908 commit b33cc89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3344,8 +3344,6 @@ struct HwDLL::Cmd_BXT_CH_CheckPoint_Create
hw.ch_checkpoint_is_duck.emplace_back(is_duck);
hw.ch_checkpoint_gravity.emplace_back(pl->v.gravity);
hw.ch_checkpoint_is_set = true;

hw.is_cstrike_dir = cl.DoesGameDirMatch("cstrike") || cl.DoesGameDirMatch("czero");
}
};

Expand Down Expand Up @@ -8281,17 +8279,20 @@ HOOK_DEF_0(HwDLL, qboolean, __cdecl, CL_ReadDemoMessage_OLD)

HOOK_DEF_1(HwDLL, void, __cdecl, LoadThisDll, const char*, szDllFilename)
{
// LoadThisDll is executed once after a server is initialized. Subsequent server initialization won't trigger LoadThisDll.
auto oldszDllFilename = szDllFilename;
std::string newszDllFilename;

auto &hw = HwDLL::GetInstance();
hw.is_cstrike_dir = ClientDLL::GetInstance().DoesGameDirMatch("cstrike");

if (boost::ends_with(szDllFilename, "metamod" DLL_EXTENSION))
{
EngineDevMsg("[hw dll] Metamod detected.\n");

bool is_failed = false;

static bool is_cstrike = ClientDLL::GetInstance().DoesGameDirMatch("cstrike");
if (is_cstrike)
if (hw.is_cstrike_dir)
{
#ifdef _WIN32
const std::string cs_lib = "dlls\\mp";
Expand Down

0 comments on commit b33cc89

Please sign in to comment.