fix: disabled frame skipping on xash3d still works partially (ref #593)
This commit is contained in:
parent
c63cccb1a2
commit
18fe797c7b
2 changed files with 19 additions and 9 deletions
|
|
@ -1664,21 +1664,23 @@ void Bot::newRound () {
|
|||
pushChatterMessage (Chatter::NewRound);
|
||||
}
|
||||
auto thinkFps = cr::clamp (cv_think_fps.as <float> (), 30.0f, 90.0f);
|
||||
auto updateInterval = 1.0f / thinkFps;
|
||||
|
||||
if (game.is (GameFlags::Xash3D)) {
|
||||
if (cv_think_fps_disable) {
|
||||
updateInterval = 0.0f;
|
||||
}
|
||||
else if (thinkFps < 50) {
|
||||
auto updateInterval = 1.0f / thinkFps;
|
||||
auto commandInterval = 1.0f / 60.0f;
|
||||
|
||||
if (game.is (GameFlags::Xash3D | GameFlags::Xash3DLegacy)) {
|
||||
if (thinkFps < 50) {
|
||||
updateInterval = 1.0f / 50.0f; // xash3d works acceptable at 50fps
|
||||
}
|
||||
}
|
||||
else if (game.is (GameFlags::Legacy)) {
|
||||
updateInterval = 0.0f; // legacy games behaves strange, when this enabled
|
||||
|
||||
// legacy games behaves strange, when this enabled, disable for xash3d as well if requested
|
||||
if (bots.isFrameSkipDisabled ()) {
|
||||
updateInterval = 0.0f;
|
||||
commandInterval = 0.0f;
|
||||
}
|
||||
m_thinkDelay.interval = updateInterval;
|
||||
m_commandDelay.interval = 1.0f / 60.0f;
|
||||
m_commandDelay.interval = commandInterval;
|
||||
}
|
||||
|
||||
void Bot::resetPathSearchType () {
|
||||
|
|
@ -2308,3 +2310,10 @@ bool BotManager::isLineBlockedBySmoke (const Vector &from, const Vector &to, flo
|
|||
// return true if the total length of smoke-covered line-of-sight is too much
|
||||
return (totalSmokedLength > maxSmokedLength);
|
||||
}
|
||||
|
||||
bool BotManager::isFrameSkipDisabled () {
|
||||
if (game.is (GameFlags::Legacy)) {
|
||||
return true;
|
||||
}
|
||||
return game.is (GameFlags::Xash3D | GameFlags::Xash3DLegacy) && cv_think_fps_disable;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue