1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

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

This commit is contained in:
Frank Zago 2010-09-05 16:33:19 +00:00
parent 24218eba67
commit b1636fd920

View File

@ -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