aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Remák2018-08-29 18:37:48 +0200
committerĽubomír Remák2018-08-29 19:13:55 +0200
commit260811106c37dbda60c3c1cd312f790ceead721a (patch)
tree5ee046dfaf423d1fbb6b39f784f81ed4648e3953
parent81789162d3f76ef827eeff7e042ab79206b7b92f (diff)
downloadscummvm-rg350-260811106c37dbda60c3c1cd312f790ceead721a.tar.gz
scummvm-rg350-260811106c37dbda60c3c1cd312f790ceead721a.tar.bz2
scummvm-rg350-260811106c37dbda60c3c1cd312f790ceead721a.zip
MUTATIONOFJB: Allow script commands to access all objects.
Previously objects with IDs beyond the defined number of objects were not accessible to IfCommand and ChangeObjectCommand. For example, this would cause script errors inside Fisher's house.
-rw-r--r--engines/mutationofjb/commands/changecommand.cpp2
-rw-r--r--engines/mutationofjb/commands/ifcommand.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/mutationofjb/commands/changecommand.cpp b/engines/mutationofjb/commands/changecommand.cpp
index 9051e8eeaa..c97fe726d7 100644
--- a/engines/mutationofjb/commands/changecommand.cpp
+++ b/engines/mutationofjb/commands/changecommand.cpp
@@ -405,7 +405,7 @@ Command::ExecuteResult ChangeObjectCommand::execute(ScriptExecutionContext &scri
return Finished;
}
- Object *const object = scene->getObject(_entityId);
+ Object *const object = scene->getObject(_entityId, true);
if (!object) {
return Finished;
}
diff --git a/engines/mutationofjb/commands/ifcommand.cpp b/engines/mutationofjb/commands/ifcommand.cpp
index 47e06f3309..fb48787af2 100644
--- a/engines/mutationofjb/commands/ifcommand.cpp
+++ b/engines/mutationofjb/commands/ifcommand.cpp
@@ -89,7 +89,7 @@ Command::ExecuteResult IfCommand::execute(ScriptExecutionContext &scriptExecCtx)
return Finished;
}
- Object *const object = scene->getObject(_objectId);
+ Object *const object = scene->getObject(_objectId, true);
if (!object) {
return Finished;
}