aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp37
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);