diff options
| -rw-r--r-- | scumm/script_v6.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index e6325d468e..b92840e2d9 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -3115,15 +3115,15 @@ void ScummEngine_v6::o6_unknownE1() { void ScummEngine_v6::o6_unknownE4() { int arg = pop(); const byte *room = getResourceAddress(rtRoom, _roomResource); - const byte *boxd = room; - const byte *boxm = room; + const byte *boxd, *boxm; int32 dboxSize, mboxSize; + ResourceIterator boxds(room, false); for (int i = 0; i < arg; i++) - boxd = findResource(MKID('BOXD'), boxd); + boxd = boxds.findNext(MKID('BOXD')); if (!boxd) - error("ScummEngine_v6::o6_unknownE4: Can't find boxes for set %d", arg); + error("ScummEngine_v6::o6_unknownE4: Can't find dboxes for set %d", arg); dboxSize = READ_BE_UINT32(boxd + 4); byte *matrix = createResource(rtMatrix, 2, dboxSize); @@ -3131,11 +3131,12 @@ void ScummEngine_v6::o6_unknownE4() { assert(matrix); memcpy(matrix, boxd, dboxSize); + ResourceIterator boxms(room, false); for (int i = 0; i < arg; i++) - boxm = findResource(MKID('BOXM'), boxm); + boxm = boxms.findNext(MKID('BOXM')); if (!boxm) - error("ScummEngine_v6::o6_unknownE4: Can't find boxes for set %d", arg); + error("ScummEngine_v6::o6_unknownE4: Can't find mboxes for set %d", arg); mboxSize = READ_BE_UINT32(boxd + 4); matrix = createResource(rtMatrix, 1, mboxSize); |
