mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
CConsole::FindFromPartial light cleanup
Improve readability by moving logic out of conditional scopes.
This commit is contained in:
parent
703caebe6b
commit
10f728081c
@ -449,19 +449,26 @@ void CConsole::FindFromPartial(void)
|
||||
|
||||
for (size_t i = 0; i < m_vsvCommandBases.size(); i++)
|
||||
{
|
||||
if (m_vSuggest.size() < con_suggestion_limit->GetSizeT())
|
||||
if (m_vSuggest.size() >= con_suggestion_limit->GetSizeT())
|
||||
{
|
||||
if (m_vsvCommandBases[i].m_svName.find(m_szInputBuf) != string::npos)
|
||||
return;
|
||||
}
|
||||
if (m_vsvCommandBases[i].m_svName.find(m_szInputBuf) == string::npos)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (std::find(m_vSuggest.begin(), m_vSuggest.end(),
|
||||
m_vsvCommandBases[i].m_svName) == m_vSuggest.end())
|
||||
{
|
||||
string svValue; int nFlags = 0;
|
||||
string svValue; int nFlags = FCVAR_NONE;
|
||||
ConCommandBase* pCommandBase = g_pCVar->FindCommandBase(m_vsvCommandBases[i].m_svName.c_str());
|
||||
|
||||
if (ConCommandBase* pCommandBase = g_pCVar->FindCommandBase(m_vsvCommandBases[i].m_svName.c_str()))
|
||||
{
|
||||
if (!pCommandBase->IsFlagSet(FCVAR_HIDDEN))
|
||||
if (!pCommandBase || pCommandBase->IsFlagSet(FCVAR_HIDDEN))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pCommandBase->IsCommand())
|
||||
{
|
||||
ConVar* pConVar = reinterpret_cast<ConVar*>(pCommandBase);
|
||||
@ -502,10 +509,6 @@ void CConsole::FindFromPartial(void)
|
||||
}
|
||||
m_vSuggest.push_back(CSuggest(m_vsvCommandBases[i].m_svName + svValue, nFlags));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { break; }
|
||||
}
|
||||
std::sort(m_vSuggest.begin(), m_vSuggest.end());
|
||||
|
Loading…
x
Reference in New Issue
Block a user