From 58cfbb532bd5092b3159211713c146c94dacead9 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 15 Nov 2017 23:40:36 +0000 Subject: SUPERNOVA: Fix room rendering It could initially access the wrong image to check the number of section. The code was working fine as long as it had one section, so there was probably no bad side effect to using the wrong image (except if it was NULL). --- engines/supernova/supernova.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index c0b9216de1..66fde2806f 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -480,11 +480,12 @@ void SupernovaEngine::restoreScreen() { void SupernovaEngine::renderRoom(Room &room) { if (room.getFileNumber() != -1) { + _currentImage = &(_images[room.getFileNumber()]); for (int i = 0; i < _currentImage->_numSections; ++i) { int section = i; if (room.isSectionVisible(section)) { do { - renderImage(room.getFileNumber(), section); + renderImage(*_currentImage, section); section = _currentImage->_section[section].next; } while (section != 0); } -- cgit v1.2.3