aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-01-22 12:06:02 +0100
committerShauren <shauren.trinity@gmail.com>2018-12-09 14:18:42 +0100
commit217a9bb34ddfde128df1567877cbef7df8729c28 (patch)
tree1b58a647d7b2f76bdbc4777b19121559ec977619 /src/server/game/Maps/Map.cpp
parent63fa69d39fea93b96337f0aff441ea1867436c1c (diff)
Core/Vmaps: Changed error message when loading outdated vmaps
Closes #18431 Closes #18857 (cherry-picked from c90882ed6e2aba3b2d421abdc17cb57bea61d04b)
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index dfd8b7fd5b7..a0e7043532d 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -125,13 +125,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;
}
}
}