Rev 1784

Hello,

rev 1784 introduced some changes in the Lod Handler:

    203 void CLodHandler::init(std::string lodFile, std::string dirName)
   ....
    237         if (ext == ".MSK" || ext == ".MSG")
    238             entry.nameStr[dotPos] = '#';//this files have same name as def - rename to defName#msk
    239         else
    240             entry.nameStr.erase(dotPos);//filename.ext becomes filename

When I run the client I get:

What’s the purpose of that change ?

Purpose of this change is to allow replacing file.pcx in LOD with file.anyExtension in folder. But since we have file.def, file.msk, file.msg I’ve added that changes.
As result file.def can be replaced with file.whatever and file.msk with file#msk.whatever

If I am correct such error can appear only if this file is missing in .lod archive but present in /sprites folder. Don’t see any other way to cause this…
In this case replacing this lines:
CLodHandler:264

if ( dotPos != -1 )//extension found
	name.erase(dotPos);

with the lines you mentioned:
CLodHandler:237

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

should help.

Thanks. That fixed the crash.

When i run. Vcmi, my ‘alogcat’ says “F/VCMI(7157): Cannot find file ZGARN002” &
"F/VCMI(7157): Fatal error. Missing game file: ZGARN002.DEF. Aborting!

This is file from WoG, you can downloaded it here:
maps4heroes.com/heroes3/in_t … f_gods.php