1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Fix late-registered ConCommands not saving handle

This commit is contained in:
Nick Hastings 2023-05-18 23:18:34 -04:00 committed by Nicholas Hastings
parent e145eae33e
commit 311c966f97

View File

@ -52,12 +52,14 @@ public:
{
if ( s_bConCommandsRegistered )
{
g_pCVar->RegisterConCommand( pCmd, s_nCVarFlag );
if ( !pCmd->GetRef()->handle.IsValid() )
ConCommandHandle hndl = g_pCVar->RegisterConCommand( pCmd, s_nCVarFlag );
if ( !hndl.IsValid() )
{
Plat_FatalErrorFunc( "RegisterConCommand: Unknown error registering con command \"%s\"!\n", pCmd->GetName() );
DebuggerBreakIfDebugging();
}
pCmd->SetHandle( hndl );
}
else
{