Explorar o código

Fix for file found in directory, but not in in LOD archive.

Frank Zago %!s(int64=15) %!d(string=hai) anos
pai
achega
b1636fd920
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      hch/CLodHandler.cpp

+ 5 - 2
hch/CLodHandler.cpp

@@ -260,8 +260,11 @@ void CLodHandler::init(std::string lodFile, std::string dirName)
 				std::transform(name.begin(), name.end(), name.begin(), (int(*)(int))toupper);
 				
 				int dotPos = name.find_last_of('.');
-				if ( dotPos != -1 )//extension found
-					name.erase(dotPos);
+				std::string ext = name.substr(dotPos);
+				if (ext == ".MSK" || ext == ".MSG")
+					name[dotPos] = '#';//this files have same name as def - rename to defName#msk
+				else
+					name.erase(dotPos);//filename.ext becomes filename
 				
 				Entry * e = entries.znajdz(name);
 				if(e) //file present in .lod - overwrite its entry