From 9b80517edababa97189affd505f3629bfe1f6b74 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 31 Jan 2025 19:58:28 +0300 Subject: [PATCH] graph: do not spam about problem nav: tweaked stuck values and timers --- inc/constant.h | 2 +- inc/engine.h | 3 +++ src/engine.cpp | 6 ++++++ src/navigate.cpp | 4 ++-- src/storage.cpp | 6 +++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/inc/constant.h b/inc/constant.h index 167a3a3..108ca9d 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -439,7 +439,7 @@ constexpr auto kSprayDistanceX2 = kSprayDistance * 2; constexpr auto kMaxChatterRepeatInterval = 99.0f; constexpr auto kViewFrameUpdate = 1.0f / 25.0f; constexpr auto kGrenadeDamageRadius = 385.0f; -constexpr auto kMinMovedDistance = 3.0f; +constexpr auto kMinMovedDistance = 2.0f; constexpr auto kInfiniteDistanceLong = static_cast (kInfiniteDistance); constexpr auto kMaxWeapons = 32; diff --git a/inc/engine.h b/inc/engine.h index 6b740a8..ed9bb12 100644 --- a/inc/engine.h +++ b/inc/engine.h @@ -274,6 +274,9 @@ public: // mark breakable entity as invalid void markBreakableAsInvalid (edict_t *ent); + // is developer mode ? + bool isDeveloperMode () const; + // public inlines public: // get the current time on server diff --git a/src/engine.cpp b/src/engine.cpp index 064f48d..b36c597 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1265,6 +1265,12 @@ void Game::markBreakableAsInvalid (edict_t *ent) { m_checkedBreakables[indexOfEntity (ent)] = false; } +bool Game::isDeveloperMode () const { + static ConVarRef developer { "developer" }; + + return developer.exists () && developer.value () > 0.0f; +} + void LightMeasure::initializeLightstyles () { // this function initializes lighting information... diff --git a/src/navigate.cpp b/src/navigate.cpp index 6aa6415..f476aaf 100644 --- a/src/navigate.cpp +++ b/src/navigate.cpp @@ -465,7 +465,7 @@ void Bot::resetCollision () { void Bot::ignoreCollision () { resetCollision (); - m_lastCollTime = game.time () + m_frameInterval * 4.0f; + m_lastCollTime = game.time () + 0.5f; m_checkTerrain = false; } @@ -520,7 +520,7 @@ void Bot::doPlayerAvoidance (const Vector &normal) { setStrafeSpeed (normal, -pev->maxspeed); } } - const float interval = m_frameInterval * (!isDucking () && pev->velocity.lengthSq2d () > 0.0f ? 7.5f : 2.0f); + const float interval = m_frameInterval * (!isDucking () && pev->velocity.lengthSq2d () > 0.0f ? 6.0f : 2.0f); // use our movement angles, try to predict where we should be next frame Vector right {}, forward {}; diff --git a/src/storage.cpp b/src/storage.cpp index 068526e..d93dd5e 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -85,7 +85,11 @@ template bool BotStorage::load (SmallArray &data, ExtenHeader * if (tryReload ()) { return true; } - return error (isGraph, isDebug, file, "Unable to open %s file for reading (filename: '%s').", type.name, filename); + + if (game.isDeveloperMode ()) { + return error (isGraph, isDebug, file, "Unable to open %s file for reading (filename: '%s').", type.name, filename); + } + return false; } // read the header