Browse Source

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

Frank Zago 15 years ago
parent
commit
b1636fd920
1 changed files with 5 additions and 2 deletions
  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