aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-04 10:06:53 +0000
committerMax Horn2002-07-04 10:06:53 +0000
commit91abe5482161dbe962b4ab5dd27a6a0ba5f09812 (patch)
tree6fef54668ea223c40f97e82767a4a12cab3476f0 /script_v1.cpp
parent87cbab8d9619d43aad5781efdb590f7ea2a1a8bf (diff)
downloadscummvm-rg350-91abe5482161dbe962b4ab5dd27a6a0ba5f09812.tar.gz
scummvm-rg350-91abe5482161dbe962b4ab5dd27a6a0ba5f09812.tar.bz2
scummvm-rg350-91abe5482161dbe962b4ab5dd27a6a0ba5f09812.zip
fixed monkeyvga crasher that occured at least in the german version, but potentially could show up in others, too - this was supposed to me in my commit from yesterday, and contains the actual fix, but was somehow left out
svn-id: r4455
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/script_v1.cpp b/script_v1.cpp
index 8615654373..70e8e18108 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -2170,7 +2170,21 @@ void Scumm::o5_setObjectName()
error("Can't set name of object %d", obj);
name = getObjOrActorName(obj);
- size = getResourceDataSize(name);
+
+ if (_features & GF_SMALL_HEADER) {
+ // FIXME this is hack to make MonkeyVGA work. needed at least for the german
+ // version but possibly for others as well. There is no apparent other
+ // way to determine the available space that works in all cases...
+ byte *objptr;
+ byte offset = 0;
+
+ objptr = getOBCDFromObject(obj);
+ offset = READ_LE_UINT16(objptr + 18);
+ size = READ_LE_UINT16(objptr) - offset;
+ } else {
+ size = getResourceDataSize(name);
+ }
+
i = 0;
while ((a = fetchScriptByte()) != 0) {