Repository navigation
Conversation
| if ( m_simThinkList[i].nextThinkTick <= gpGlobals->tickcount ) | ||
| { | ||
| #if defined(NEO) && defined(DBGFLAG_ASSERT) | ||
| ConVarRef nb_stop("nb_stop"); |
There was a problem hiding this comment.
Is there a case where nb_stop won’t exist when this runs? If not, it might save a few frames per second to read it directly. ConVarRef does a name lookup each time it is constructed, and here that happens for every thinking entity on every tick. #2319 optimized something similar for other hot-path ConVars.
nb_stop is already defined in the server project as ConVar NextBotStop (NextBot/NextBot.cpp), and NextBot/NextBot.h declares it extern. So no lookup and no IsValid assert are needed.
The change I had in mind is summarized in https://github.com/Rainyan/rebuild/pull/9/changes, and it resolves the Assert in the same way. Feel free to take it or leave it, either by implementing the change directly or merging the PR directly into your branch. I don't care about co-author credit, I was just struggling to summarize how to explain the #include part without making this comment field messy.
Description
If launching a "debug build" (i.e.
defined(DBGFLAG_ASSERT)), and entering a localhost game withnb_stop 1(no bot thinking allowed), it will trigger some unintended assertion spam.This PR captures that intention and skips those asserts for developer convenience.
There is no behavior changes introduced, this is purely intended to silence dev build assertions.
Toolchain
Linked Issues