mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Simplify code a bit
This commit is contained in:
parent
4f18d7f9b8
commit
409abf1b90
|
@ -353,23 +353,24 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID)
|
||||||
|
|
||||||
if(pRule->m_Value == CPosRule::INDEX)
|
if(pRule->m_Value == CPosRule::INDEX)
|
||||||
{
|
{
|
||||||
bool PosRuleTest = false;
|
|
||||||
for(int i = 0; i < pRule->m_aIndexList.size() && !PosRuleTest; ++i) {
|
|
||||||
if(CheckIndex == pRule->m_aIndexList[i].m_ID && (pRule->m_aIndexList[i].m_Flag == -1 || CheckFlags == pRule->m_aIndexList[i].m_Flag))
|
|
||||||
PosRuleTest = true;
|
|
||||||
}
|
|
||||||
if(!PosRuleTest)
|
|
||||||
RespectRules = false;
|
RespectRules = false;
|
||||||
|
for(int i = 0; i < pRule->m_aIndexList.size(); ++i) {
|
||||||
|
if(CheckIndex == pRule->m_aIndexList[i].m_ID && (pRule->m_aIndexList[i].m_Flag == -1 || CheckFlags == pRule->m_aIndexList[i].m_Flag))
|
||||||
|
{
|
||||||
|
RespectRules = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(pRule->m_Value == CPosRule::NOTINDEX)
|
else if(pRule->m_Value == CPosRule::NOTINDEX)
|
||||||
{
|
{
|
||||||
bool PosRuleTest = true;
|
for(int i = 0; i < pRule->m_aIndexList.size(); ++i) {
|
||||||
for(int i = 0; i < pRule->m_aIndexList.size() && PosRuleTest; ++i) {
|
|
||||||
if(CheckIndex == pRule->m_aIndexList[i].m_ID && (pRule->m_aIndexList[i].m_Flag == -1 || CheckFlags == pRule->m_aIndexList[i].m_Flag))
|
if(CheckIndex == pRule->m_aIndexList[i].m_ID && (pRule->m_aIndexList[i].m_Flag == -1 || CheckFlags == pRule->m_aIndexList[i].m_Flag))
|
||||||
PosRuleTest = false;
|
{
|
||||||
}
|
|
||||||
if(!PosRuleTest)
|
|
||||||
RespectRules = false;
|
RespectRules = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue