Skip to content

Ignore assertion failure for nb_stop 1 on assert builds - #2320

Open
Rainyan wants to merge 1 commit into
NeotokyoRebuild:masterfrom
Rainyan:master
Open

Rainyan wants to merge 1 commit into
NeotokyoRebuild:masterfrom
Rainyan:master

Conversation

@Rainyan

@Rainyan Rainyan commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Description

If launching a "debug build" (i.e. defined(DBGFLAG_ASSERT)), and entering a localhost game with nb_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

  • gcc (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3)

Linked Issues

if ( m_simThinkList[i].nextThinkTick <= gpGlobals->tickcount )
{
#if defined(NEO) && defined(DBGFLAG_ASSERT)
ConVarRef nb_stop("nb_stop");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants