Prevent spawning bots when not being host

Fixes #253
This commit is contained in:
momo5502 2023-02-28 07:35:12 +01:00
parent cd64b410fd
commit 2d2f1d2968
2 changed files with 2 additions and 7 deletions

View File

@ -80,13 +80,7 @@ namespace getinfo
bool is_host()
{
if (game::is_server())
{
return true;
}
const auto client_states = *reinterpret_cast<uint64_t*>(0x1576FB318_g);
return client_states == 0;
return game::SV_Loaded() && (game::is_server() || !game::Com_IsRunningUILevel());
}
struct component final : generic_component

View File

@ -129,6 +129,7 @@ namespace game
};
// SV
WEAK symbol<bool()> SV_Loaded{0x142252CB0, 0x140535460};
WEAK symbol<void*()> SV_AddTestClient{0x1422499A0, 0x14052E3E0};
WEAK symbol<void(client_s* cl_0, svscmd_type type, const char* fmt, ...)> SV_SendServerCommand{0x0, 0x140537F10};
WEAK symbol<bool(int clientNum)> SV_IsTestClient{0x14224B5C0, 0x14052FF40};