aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorKari Salminen2008-05-29 22:07:25 +0000
committerKari Salminen2008-05-29 22:07:25 +0000
commitb7deac38b3a529701a9c4866062e1db2db6214c4 (patch)
treeec8cd2a8370237ce203e62e6c3fe209f64f691db /engines/cine
parent5396cd5dedd039fa40b46ef0f86cd757de4de259 (diff)
downloadscummvm-rg350-b7deac38b3a529701a9c4866062e1db2db6214c4.tar.gz
scummvm-rg350-b7deac38b3a529701a9c4866062e1db2db6214c4.tar.bz2
scummvm-rg350-b7deac38b3a529701a9c4866062e1db2db6214c4.zip
Added check in modifyObjectParam's start (Verified with FW & OS PC versions' disassemblies). Also removed superfluous default-case, hopefully no compiler will complain about this :).
svn-id: r32371
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/object.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index d7b4b853ae..7666f05352 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -185,6 +185,10 @@ void addObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
}
void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
+ // Operation Stealth checks object index range, Future Wars doesn't.
+ if (g_cine->getGameType() == Cine::GType_OS && objIdx >= NUM_MAX_OBJECT)
+ return;
+
switch (paramIdx) {
case 1:
objectTable[objIdx].x = newValue;
@@ -214,8 +218,6 @@ void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
case 6:
objectTable[objIdx].part = newValue;
break;
- default: // No-operation
- break;
}
}