aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-23 04:46:04 +0200
committerWillem Jan Palenstijn2015-12-23 21:43:16 +0100
commit07da047fa1d519190478c1b26e5d65816edb17b3 (patch)
tree5fe48410d06b822f6330a48ae8530315180e1aba
parentc855cd46df2b04cca08aeba68672e9828f8203fa (diff)
downloadscummvm-rg350-07da047fa1d519190478c1b26e5d65816edb17b3.tar.gz
scummvm-rg350-07da047fa1d519190478c1b26e5d65816edb17b3.tar.bz2
scummvm-rg350-07da047fa1d519190478c1b26e5d65816edb17b3.zip
LAB: Fix the find_action command
-rw-r--r--engines/lab/console.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/lab/console.cpp b/engines/lab/console.cpp
index 00f8921baf..4aa949054b 100644
--- a/engines/lab/console.cpp
+++ b/engines/lab/console.cpp
@@ -88,7 +88,7 @@ bool Console::Cmd_DumpSceneResources(int argc, const char **argv) {
while (rule->_actionList) {
Action *action = rule->_actionList;
- debugPrintf(" - %s (%s, %d, %d, %d)\n", actionTypes[action->_actionType], action->_messages[0].c_str(), action->_param1, action->_param2, action->_param3);
+ debugPrintf(" - %s ('%s', %d, %d, %d)\n", actionTypes[action->_actionType], action->_messages[0].c_str(), action->_param1, action->_param2, action->_param3);
rule->_actionList = rule->_actionList->_nextAction;
}
}
@@ -105,15 +105,21 @@ bool Console::Cmd_FindAction(int argc, const char **argv) {
int actionId = atoi(argv[1]);
int param1 = (argc > 2) ? atoi(argv[2]) : -1;
int param2 = (argc > 3) ? atoi(argv[3]) : -1;
+ int param3 = (argc > 4) ? atoi(argv[4]) : -1;
for (uint16 i = 1; i <= _vm->_manyRooms; i++) {
_vm->_resource->readViews(i);
for (RuleList::iterator rule = _vm->_rooms[i]._rules->begin(); rule != _vm->_rooms[i]._rules->end(); ++rule) {
- if (rule->_ruleType == actionId &&
- (rule->_param1 == param1 || param1 == -1) &&
- (rule->_param2 == param2 || param2 == -1)) {
- debugPrintf("Found at script %d\n", i);
+ while (rule->_actionList) {
+ if (rule->_actionList->_actionType == actionId &&
+ (rule->_actionList->_param1 == param1 || param1 == -1) &&
+ (rule->_actionList->_param2 == param2 || param2 == -1) &&
+ (rule->_actionList->_param3 == param3 || param3 == -1)) {
+ debugPrintf("Found at script %d\n", i);
+ }
+
+ rule->_actionList = rule->_actionList->_nextAction;
}
}
}