aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
authorJames Brown2002-08-01 09:25:09 +0000
committerJames Brown2002-08-01 09:25:09 +0000
commit3b2ba8cf0207b8295c2d9421f24d4949c99a12fb (patch)
treeb043ee05c5a7dfbef80bbfa3d4b752be7b42c7e0 /script_v1.cpp
parent3ab2d71154172f6f900f3c1b2e04aad7e3b44b4e (diff)
downloadscummvm-rg350-3b2ba8cf0207b8295c2d9421f24d4949c99a12fb.tar.gz
scummvm-rg350-3b2ba8cf0207b8295c2d9421f24d4949c99a12fb.tar.bz2
scummvm-rg350-3b2ba8cf0207b8295c2d9421f24d4949c99a12fb.zip
#587553 hack
svn-id: r4684
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/script_v1.cpp b/script_v1.cpp
index 59cb5b986e..1f59a0186f 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -2116,16 +2116,28 @@ void Scumm::o5_setObjectName()
int obj = getVarOrDirectWord(0x80);
int size;
int a;
- int i;
- byte *name;
+ int i = 0;
+ byte *name = NULL;
unsigned char work[255];
if (obj < NUM_ACTORS)
error("Can't set actor %d name with new-name-of", obj);
- if (!getOBCDFromObject(obj))
- error("Can't set name of object %d", obj);
-
+ if (!getOBCDFromObject(obj)) {
+ // FIXME for bug 587553. This is an odd one and looks more
+ // like an actual bug in the original script.
+ while ((a = fetchScriptByte()) != 0) {
+ work[i++] = a;
+
+ if (a == 0xFF) {
+ work[i++] = fetchScriptByte();
+ work[i++] = fetchScriptByte();
+ work[i++] = fetchScriptByte();
+ }
+ }
+ warning("Can't find OBCD to rename object %d to %s", obj, name);
+ return;
+ }
name = getObjOrActorName(obj);
if (_features & GF_SMALL_HEADER) {