From 4c3f2c30aff6f4d71e673cce134cb4e9742a6cb0 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 18 Sep 2019 15:50:04 +0200 Subject: SUPERNOVA: Fix reading of .dat file When searching for the right block in supernova.dat, the engine didn't take into account the full size of each block (it thought, it read 12 bytes less in each block) and thanks to that it tryed to read one additional block at the end. --- engines/supernova/supernova.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index 41f05edb7e..e23251c2f3 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -501,7 +501,8 @@ Common::SeekableReadStream *SupernovaEngine::getBlockFromDatFile(Common::String return f.readStream(size); } else { f.skip(size); - readSize += size; + // size + 4 bytes for id + 4 bytes for lang + 4 bytes for size + readSize += size + 12; } } -- cgit v1.2.3