Browse Source

- fixed (at least partially) #1100

Ivan Savenko 13 years ago
parent
commit
74cd2e77fe
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/map.cpp

+ 2 - 1
lib/map.cpp

@@ -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();
 	}
 }