From aa661fae5c3a6be2d09a0a6632770131ff02c550 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 26 Mar 2016 14:54:04 +0100 Subject: ADL: Fix room loading in hires2 --- engines/adl/hires2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/adl/hires2.cpp') diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp index 39f2199e6a..d4f1c09499 100644 --- a/engines/adl/hires2.cpp +++ b/engines/adl/hires2.cpp @@ -214,6 +214,7 @@ void HiRes2Engine::loadRoom(byte roomNr) { uint16 descOffset = stream->readUint16LE(); uint16 commandOffset = stream->readUint16LE(); + _roomData.pictures.clear(); // There's no picture count. The original engine always checks at most // five pictures. We use the description offset to bound our search. uint16 picCount = (descOffset - 4) / 5; @@ -226,8 +227,11 @@ void HiRes2Engine::loadRoom(byte roomNr) { _roomData.description = readStringAt(*stream, descOffset, 0xff); - stream->seek(commandOffset); - readCommands(*stream, _roomData.commands); + _roomData.commands.clear(); + if (commandOffset != 0) { + stream->seek(commandOffset); + readCommands(*stream, _roomData.commands); + } } void HiRes2Engine::showRoom() { -- cgit v1.2.3