Prevent recursion in sm_ServerCommandEx (fixes #967) (#2133)

* Prevent recursion in sm_ServerCommandEx (fixes #967)

* Update core/smn_console.cpp to fix style

Co-authored-by: Erin <asherkin@limetech.io>

---------

Co-authored-by: Odin Landers <ojl9576@rit.edu>
Co-authored-by: Erin <asherkin@limetech.io>
This commit is contained in:
ojlanders 2024-04-18 07:42:37 -04:00 committed by GitHub
parent 5c507cc35c
commit 6cac489fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -979,11 +979,14 @@ static cell_t sm_ServerCommandEx(IPluginContext *pContext, const cell_t *params)
}
engine->ServerExecute();
g_ShouldCatchSpew = true;
engine->ServerCommand("sm_conhook_start\n");
engine->ServerCommand(buffer);
engine->ServerCommand("sm_conhook_stop\n");
if (!g_ShouldCatchSpew) {
g_ShouldCatchSpew = true;
engine->ServerCommand("sm_conhook_start\n");
engine->ServerCommand(buffer);
engine->ServerCommand("sm_conhook_stop\n");
} else {
engine->ServerCommand(buffer);
}
engine->ServerExecute();