fixed bug that custom int tokens were not considered in conditions

This commit is contained in:
louis 2015-01-19 09:41:49 +01:00
parent cb9044e5f6
commit 252c15cbc4
2 changed files with 18 additions and 14 deletions

View File

@ -159,4 +159,4 @@ Version 0.1.4
- added "empty" operator additionally to "isset" to check in a condition - added "empty" operator additionally to "isset" to check in a condition
if a string token is set if a string token is set
- added token {nummenuitem} for plugin menu lists - added token {nummenuitem} for plugin menu lists
- fixed bug that custom int tokens were not considered in conditions

View File

@ -342,7 +342,12 @@ int cConditionalParameter::EvaluateParameter(string token, map < string, int > *
map < string, int >::iterator hitGlobals = globals->intVars.find(token); map < string, int >::iterator hitGlobals = globals->intVars.find(token);
if (hitGlobals != globals->intVars.end()) { if (hitGlobals != globals->intVars.end()) {
return hitGlobals->second; return hitGlobals->second;
} else { }
//then check custom tokens
map < string, int >::iterator hitCustomTokens = globals->customIntTokens.find(token);
if (hitCustomTokens != globals->customIntTokens.end()) {
return hitCustomTokens->second;
}
//then check tokens //then check tokens
if (intTokens) { if (intTokens) {
map < string, int >::iterator hit = intTokens->find(token); map < string, int >::iterator hit = intTokens->find(token);
@ -357,7 +362,6 @@ int cConditionalParameter::EvaluateParameter(string token, map < string, int > *
return atoi(value.c_str()); return atoi(value.c_str());
} }
} }
}
return 0; return 0;
} }