Core/Vmaps: Changed error message when loading outdated vmaps

Closes #18431
Closes #18857
This commit is contained in:
Shauren
2017-01-22 12:06:02 +01:00
committed by Aokromes
parent 191e277741
commit dc2deb8602
6 changed files with 35 additions and 19 deletions

View File

@@ -103,13 +103,20 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy)
{
if (vmgr->isMapLoadingEnabled())
{
bool exists = vmgr->existsMap((sWorld->GetDataPath()+ "vmaps").c_str(), mapid, gx, gy);
if (!exists)
VMAP::LoadResult result = vmgr->existsMap((sWorld->GetDataPath() + "vmaps").c_str(), mapid, gx, gy);
std::string name = vmgr->getDirFileName(mapid, gx, gy);
switch (result)
{
std::string name = vmgr->getDirFileName(mapid, gx, gy);
TC_LOG_ERROR("maps", "VMap file '%s' does not exist", (sWorld->GetDataPath()+"vmaps/"+name).c_str());
TC_LOG_ERROR("maps", "Please place VMAP-files (*.vmtree and *.vmtile) in the vmap-directory (%s), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath()+"vmaps/").c_str());
return false;
case VMAP::LoadResult::Success:
break;
case VMAP::LoadResult::FileNotFound:
TC_LOG_ERROR("maps", "VMap file '%s' does not exist", (sWorld->GetDataPath() + "vmaps/" + name).c_str());
TC_LOG_ERROR("maps", "Please place VMAP files (*.vmtree and *.vmtile) in the vmap directory (%s), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "vmaps/").c_str());
return false;
case VMAP::LoadResult::VersionMismatch:
TC_LOG_ERROR("maps", "VMap file '%s' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name).c_str());
TC_LOG_ERROR("maps", "This is because the version of the VMap file and the version of this module are different, please re-extract the maps with the tools compiled with this module.");
return false;
}
}
}