From 1ec06340da2f5790fa13c2a41e9dcfc3b3505b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20G=C3=B6ffringmann?= Date: Mon, 13 Dec 2004 02:02:47 +0000 Subject: [PATCH] fixed a bug that I introduced with the last cleanup. (caused the graphical glitches in the pipe factory) svn-id: r16043 --- sky/disk.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sky/disk.cpp b/sky/disk.cpp index 2fd4917048a..104f4536530 100644 --- a/sky/disk.cpp +++ b/sky/disk.cpp @@ -167,7 +167,8 @@ uint8 *Disk::loadFile(uint16 fileNr) { #endif memcpy(uncompDest, fileDest, sizeof(dataFileHeader)); unpackLen = rncDecoder.unpackM1(fileDest + sizeof(dataFileHeader), uncompDest + sizeof(dataFileHeader), 0); - unpackLen += sizeof(dataFileHeader); + if (unpackLen) + unpackLen += sizeof(dataFileHeader); } debug(3, "UnpackM1 returned: %d", unpackLen); @@ -177,7 +178,7 @@ uint8 *Disk::loadFile(uint16 fileNr) { return fileDest; } else { if (unpackLen != (int32)decompSize) - debug(1, "ERROR: invalid decomp size! (was: %d, should be: %d)", unpackLen, decompSize); + debug(1, "ERROR: File %d: invalid decomp size! (was: %d, should be: %d)", fileNr, unpackLen, decompSize); _lastLoadedFileSize = decompSize; free(fileDest);