1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

- fixed (at least partially) #1100

This commit is contained in:
Ivan Savenko 2012-09-29 09:39:05 +00:00
parent b0f669a764
commit 74cd2e77fe

View File

@ -509,7 +509,7 @@ TInputStreamPtr Mapa::getMapStream(std::string URI)
ui32 header = reader.readUInt32();
file->seek(0); //reset file
switch (header)
switch (header & 0xffffff) // gzip header is 3 bytes only in size
{
case 0x00088B1F: // gzip header magic number, reversed for LE
return TInputStreamPtr(new CCompressedStream(std::move(file), true));
@ -519,6 +519,7 @@ TInputStreamPtr Mapa::getMapStream(std::string URI)
case CMapHeader::SoD :
return file;
default :
tlog0 << "Error: Failed to open map " << URI << ": unknown format\n";
return TInputStreamPtr();
}
}