diff options
author | Max Horn | 2004-03-17 01:50:15 +0000 |
---|---|---|
committer | Max Horn | 2004-03-17 01:50:15 +0000 |
commit | faa12496e48b2eef79f92ae8e8ec69241cfd7d86 (patch) | |
tree | a319fe1df6df4609e987d73d1fb87abb94d64431 /scumm/script_v2.cpp | |
parent | 93ef5161a52f8a0dc6f36439c6441f97c4187cd8 (diff) | |
download | scummvm-rg350-faa12496e48b2eef79f92ae8e8ec69241cfd7d86.tar.gz scummvm-rg350-faa12496e48b2eef79f92ae8e8ec69241cfd7d86.tar.bz2 scummvm-rg350-faa12496e48b2eef79f92ae8e8ec69241cfd7d86.zip |
Fix for bug #893254 (MI1VGA: Changes in object names are not saved); this may introduce regressions, please report them (overall, this is a neat patch, it removes so many ugly hacks :-)
svn-id: r13325
Diffstat (limited to 'scumm/script_v2.cpp')
-rw-r--r-- | scumm/script_v2.cpp | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 661491656d..c3d3d1b398 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -141,7 +141,7 @@ void ScummEngine_v2::setupOpcodes() { OPCODE(o5_actorFollowCamera), OPCODE(o2_actorOps), /* 54 */ - OPCODE(o2_setObjectName), + OPCODE(o5_setObjectName), OPCODE(o2_actorFromPos), OPCODE(o5_getActorMoving), OPCODE(o2_setState02), @@ -301,7 +301,7 @@ void ScummEngine_v2::setupOpcodes() { OPCODE(o5_actorFollowCamera), OPCODE(o2_actorOps), /* D4 */ - OPCODE(o2_setObjectName), + OPCODE(o5_setObjectName), OPCODE(o2_actorFromPos), OPCODE(o5_getActorMoving), OPCODE(o2_setState02), @@ -1484,54 +1484,6 @@ void ScummEngine_v2::o2_pickupObject() { runInventoryScript(1); } -void ScummEngine_v2::o2_setObjectName() { - int obj = getVarOrDirectWord(PARAM_1); - int size = 0; - int a; - int i = 0; - byte *name = NULL; - byte work[256]; - - // Read in new name - do { - a = fetchScriptByte(); - work[i++] = a; - } while (a); - - if (obj < _numActors) - error("Can't set actor %d name with new-name-of", obj); - - // TODO: Would be nice if we used rtObjectName resource for pre-V6 - // games, too. The only problem with that which I can see is that this - // would break savegames. I.e. it would require yet another change to - // the save/load system. - - // FIXME: This is rather nasty code. - // Find the object name in the OBCD resource. - byte *objptr; - objptr = getOBCDFromObject(obj); - if (objptr == NULL) - return; // Silently fail for now - name = objptr + *(objptr + 14); - - while (name[size++]) - ; - - if (i > size) { - warning("New name of object %d too long (old *%s* new *%s*)", obj, name, work); - i = size; - } - - while (i < size) { - work[i - 1] = '@'; - i++; - } - work[i - 1] = 0; - - memcpy(name, work, i); - runInventoryScript(0); -} - void ScummEngine_v2::o2_cursorCommand() { // TODO: Define the magic numbers uint16 cmd = getVarOrDirectWord(PARAM_1); byte state = cmd >> 8; |