diff options
author | James Brown | 2002-08-01 09:27:50 +0000 |
---|---|---|
committer | James Brown | 2002-08-01 09:27:50 +0000 |
commit | 7d3aef6dd868a9d8bf294af3a84f23aa7d83f133 (patch) | |
tree | af47ae79e70b798f87834b0ea3165a0bade816d2 | |
parent | 3b2ba8cf0207b8295c2d9421f24d4949c99a12fb (diff) | |
download | scummvm-rg350-7d3aef6dd868a9d8bf294af3a84f23aa7d83f133.tar.gz scummvm-rg350-7d3aef6dd868a9d8bf294af3a84f23aa7d83f133.tar.bz2 scummvm-rg350-7d3aef6dd868a9d8bf294af3a84f23aa7d83f133.zip |
Clean that up a bit.
svn-id: r4685
-rw-r--r-- | script_v1.cpp | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/script_v1.cpp b/script_v1.cpp index 1f59a0186f..97d40c6c0e 100644 --- a/script_v1.cpp +++ b/script_v1.cpp @@ -2119,25 +2119,27 @@ void Scumm::o5_setObjectName() int i = 0; byte *name = NULL; unsigned char work[255]; + + // Read in new name + while ((a = fetchScriptByte()) != 0) { + work[i++] = a; + if (a == 0xFF) { + work[i++] = fetchScriptByte(); + work[i++] = fetchScriptByte(); + work[i++] = fetchScriptByte(); + } + } if (obj < NUM_ACTORS) error("Can't set actor %d name with new-name-of", 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(); - } - } + // FIXME: Bug 587553. This is an odd one and looks more like + // an actual bug in the original script. Usually we would error warning("Can't find OBCD to rename object %d to %s", obj, name); return; } + name = getObjOrActorName(obj); if (_features & GF_SMALL_HEADER) { @@ -2154,19 +2156,6 @@ void Scumm::o5_setObjectName() size = getResourceDataSize(name); } - i = 0; - - while ((a = fetchScriptByte()) != 0) { - work[i++] = a; - - if (a == 0xFF) { - work[i++] = fetchScriptByte(); - work[i++] = fetchScriptByte(); - work[i++] = fetchScriptByte(); - } - - } - if (i >= size) { work[i] = 0; warning("New name of object %d too long (old *%s* new *%s*)", obj, name, work); |