fix: crash due xash loadiing gamedll even without starting local game server

fix: zero out yb_think_fps_disable on xash when sys_ticrate > 100 (closes #677)
This commit is contained in:
jeefo 2025-03-03 21:58:35 +03:00
commit 2fb0419765
No known key found for this signature in database
GPG key ID: D696786B81B667C8
3 changed files with 23 additions and 3 deletions

View file

@ -628,7 +628,9 @@ void BotManager::kickEveryone (bool instant, bool zeroQuota) {
if (instant) {
for (const auto &bot : m_bots) {
bot->kick (true);
if (!game.isNullEntity (bot->ent ())) {
bot->kick (true);
}
}
}
m_addRequests.clear ();
@ -2330,5 +2332,17 @@ bool BotManager::isFrameSkipDisabled () {
if (game.is (GameFlags::Legacy)) {
return true;
}
return game.is (GameFlags::Xash3D) && cv_think_fps_disable;
if (game.is (GameFlags::Xash3D) && cv_think_fps_disable) {
static ConVarRef sys_ticrate ("sys_ticrate");
// ignore think_fps_disable if fps is more than 100 on xash dedicated server
if (game.isDedicated () && sys_ticrate.value () > 100.0f) {
cv_think_fps_disable.set (0);
return false;
}
return true;
}
return false;
}