aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Gunkel2012-01-22 23:06:07 +0100
committerTobias Gunkel2012-02-11 08:29:16 +0100
commitb0201a8df24462b95c786826793e46583349ee1c (patch)
tree06d7fe02e55187c18652083d06e9e99e7f9238a6
parentb31157cee3159ec266e454dec354bd928ee54629 (diff)
downloadscummvm-rg350-b0201a8df24462b95c786826793e46583349ee1c.tar.gz
scummvm-rg350-b0201a8df24462b95c786826793e46583349ee1c.tar.bz2
scummvm-rg350-b0201a8df24462b95c786826793e46583349ee1c.zip
SCUMM: fix o_setObjectName()
The parameter can either be a FG or BG object depending on the opcode.
-rw-r--r--engines/scumm/script_v0.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp
index 9fd8397596..a04f23aea8 100644
--- a/engines/scumm/script_v0.cpp
+++ b/engines/scumm/script_v0.cpp
@@ -756,9 +756,16 @@ void ScummEngine_v0::o_pickupObject() {
}
void ScummEngine_v0::o_setObjectName() {
- int obj = fetchScriptByte();
- if (!obj)
+ int obj;
+ int objId = fetchScriptByte();
+ if (!objId) {
obj = _cmdObject;
+ } else {
+ if (_opcode & 0x80)
+ obj = OBJECT_V0(objId, kObjectV0TypeBG);
+ else
+ obj = OBJECT_V0(objId, kObjectV0TypeFG);
+ }
setObjectName(obj);
}