Merge pull request #7470 from furo321/remove-map-setting-msg

Don't print "tunes"/unknown commands from maps.
This commit is contained in:
Dennis Felsing 2023-11-16 23:34:22 +00:00 committed by GitHub
commit 4e27299657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3369,6 +3369,11 @@ void CGameClient::RefindSkins()
m_KillMessages.RefindSkins();
}
static bool UnknownMapSettingCallback(const char *pCommand, void *pUser)
{
return true;
}
void CGameClient::LoadMapSettings()
{
// Reset Tunezones
@ -3403,13 +3408,14 @@ void CGameClient::LoadMapSettings()
int Size = pMap->GetDataSize(pItem->m_Settings);
char *pSettings = (char *)pMap->GetData(pItem->m_Settings);
char *pNext = pSettings;
dbg_msg("tune", "%s", pNext);
Console()->SetUnknownCommandCallback(UnknownMapSettingCallback, nullptr);
while(pNext < pSettings + Size)
{
int StrSize = str_length(pNext) + 1;
Console()->ExecuteLine(pNext, IConsole::CLIENT_ID_GAME);
pNext += StrSize;
}
Console()->SetUnknownCommandCallback(IConsole::EmptyUnknownCommandCallback, nullptr);
pMap->UnloadData(pItem->m_Settings);
break;
}