diff options
author | Strangerke | 2015-12-22 18:51:37 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:35:34 +0100 |
commit | 7380ddf40035fa3a3c6d5e7974e8f9928d6e148a (patch) | |
tree | d0b6573a7e0f3a11d2a6976f23e728bcc8187593 /engines/lab/processroom.cpp | |
parent | f3db3ba30559dffd16964fdddaa0d680fc31304a (diff) | |
download | scummvm-rg350-7380ddf40035fa3a3c6d5e7974e8f9928d6e148a.tar.gz scummvm-rg350-7380ddf40035fa3a3c6d5e7974e8f9928d6e148a.tar.bz2 scummvm-rg350-7380ddf40035fa3a3c6d5e7974e8f9928d6e148a.zip |
LAB: Change RuleList to a Common::List<Rule> as suggested by wjp
Diffstat (limited to 'engines/lab/processroom.cpp')
-rw-r--r-- | engines/lab/processroom.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 2cc002ba6f..76592875c9 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -516,13 +516,13 @@ bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closeP } for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if (((*rule)->_ruleType == ACTION) && - (((*rule)->_param1 == action) || (((*rule)->_param1 == 0) && allowDefaults))) { - if ((((*rule)->_param2 == closePtr->_closeUpType) || - (((*rule)->_param2 == 0) && allowDefaults)) || - ((action == 1) && ((*rule)->_param2 == (-closePtr->_closeUpType)))) { - if (checkConditions((*rule)->_condition)) { - doActions((*rule)->_actionList, setCloseList); + if ((rule->_ruleType == ACTION) && + ((rule->_param1 == action) || ((rule->_param1 == 0) && allowDefaults))) { + if (((rule->_param2 == closePtr->_closeUpType) || + ((rule->_param2 == 0) && allowDefaults)) || + ((action == 1) && (rule->_param2 == -closePtr->_closeUpType))) { + if (checkConditions(rule->_condition)) { + doActions(rule->_actionList, setCloseList); return true; } } @@ -564,11 +564,11 @@ bool LabEngine::doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr clos } for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if (((*rule)->_ruleType == OPERATE) && - (((*rule)->_param1 == itemNum) || (((*rule)->_param1 == 0) && allowDefaults)) && - (((*rule)->_param2 == closePtr->_closeUpType) || (((*rule)->_param2 == 0) && allowDefaults))) { - if (checkConditions((*rule)->_condition)) { - doActions((*rule)->_actionList, setCloseList); + if ((rule->_ruleType == OPERATE) && + ((rule->_param1 == itemNum) || ((rule->_param1 == 0) && allowDefaults)) && + ((rule->_param2 == closePtr->_closeUpType) || ((rule->_param2 == 0) && allowDefaults))) { + if (checkConditions(rule->_condition)) { + doActions(rule->_actionList, setCloseList); return true; } } @@ -609,8 +609,7 @@ bool LabEngine::doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *cl bool LabEngine::doGoForward(CloseDataPtr *closePtrList) { RuleList *rules = _rooms[_roomNum]._rules; - for (RuleList::iterator ruleIter = rules->begin(); ruleIter != rules->end(); ++ruleIter) { - Rule *rule = *ruleIter; + for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { if ((rule->_ruleType == GOFORWARD) && (rule->_param1 == (_direction + 1))) { if (checkConditions(rule->_condition)) { doActions(rule->_actionList, closePtrList); @@ -629,11 +628,11 @@ bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) { RuleList *rules = _rooms[_roomNum]._rules; for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if (((*rule)->_ruleType == TURN) || - (((*rule)->_ruleType == TURNFROMTO) && - ((*rule)->_param1 == from) && ((*rule)->_param2 == to))) { - if (checkConditions((*rule)->_condition)) { - doActions((*rule)->_actionList, closePtrList); + if ((rule->_ruleType == TURN) || + ((rule->_ruleType == TURNFROMTO) && + (rule->_param1 == from) && (rule->_param2 == to))) { + if (checkConditions(rule->_condition)) { + doActions(rule->_actionList, closePtrList); return true; } } @@ -645,9 +644,9 @@ bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) { bool LabEngine::doMainView(CloseDataPtr *closePtrList) { RuleList *rules = _rooms[_roomNum]._rules; for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) { - if ((*rule)->_ruleType == GOMAINVIEW) { - if (checkConditions((*rule)->_condition)) { - doActions((*rule)->_actionList, closePtrList); + if (rule->_ruleType == GOMAINVIEW) { + if (checkConditions(rule->_condition)) { + doActions(rule->_actionList, closePtrList); return true; } } |