Try to check existance of mmaps folder.
This commit is contained in:
@@ -82,10 +82,10 @@ namespace MMAP
|
||||
return uint32(x << 16 | y);
|
||||
}
|
||||
|
||||
bool MMapManager::loadMap(uint32 mapId, int32 x, int32 y)
|
||||
bool MMapManager::loadMap(const std::string& basePath, uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
// make sure the mmap is loaded and ready to load tiles
|
||||
if(!loadMapData(mapId))
|
||||
if (!loadMapData(mapId))
|
||||
return false;
|
||||
|
||||
// get this mmap data
|
||||
@@ -95,10 +95,7 @@ namespace MMAP
|
||||
// check if we already have this tile loaded
|
||||
uint32 packedGridPos = packTileID(x, y);
|
||||
if (mmap->mmapLoadedTiles.find(packedGridPos) != mmap->mmapLoadedTiles.end())
|
||||
{
|
||||
//sLog->outError("MMAP:loadMap: Asked to load already loaded navmesh tile. %03u%02i%02i.mmtile", mapId, y, x);
|
||||
return false;
|
||||
}
|
||||
|
||||
// load this tile :: mmaps/MMMXXYY.mmtile
|
||||
uint32 pathLen = sWorld->GetDataPath().length() + strlen("mmaps/%03i%02i%02i.mmtile")+1;
|
||||
@@ -136,7 +133,7 @@ namespace MMAP
|
||||
ASSERT(data);
|
||||
|
||||
size_t result = fread(data, fileHeader.size, 1, file);
|
||||
if(!result)
|
||||
if (!result)
|
||||
{
|
||||
sLog->outError("MMAP:loadMap: Bad header or data in mmap %03u%02i%02i.mmtile", mapId, y, x);
|
||||
fclose(file);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MMAP
|
||||
MMapManager() : loadedTiles(0) {}
|
||||
~MMapManager();
|
||||
|
||||
bool loadMap(uint32 mapId, int32 x, int32 y);
|
||||
bool loadMap(const std::string& basePath, uint32 mapId, int32 x, int32 y);
|
||||
bool unloadMap(uint32 mapId, int32 x, int32 y);
|
||||
bool unloadMap(uint32 mapId);
|
||||
bool unloadMapInstance(uint32 mapId, uint32 instanceId);
|
||||
|
||||
@@ -124,7 +124,7 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy)
|
||||
void Map::LoadMMap(int gx, int gy)
|
||||
{
|
||||
// DONT CHANGE "gy" and "gx" - Its necessary !
|
||||
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(GetId(), gy, gx);
|
||||
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap((sWorld->GetDataPath() + "mmaps").c_str(), GetId(), gy, gx);
|
||||
switch (mmapLoadResult)
|
||||
{
|
||||
case MMAP::MMAP_LOAD_RESULT_OK:
|
||||
|
||||
@@ -1123,8 +1123,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
sLog->outString("Using DataDir %s", m_dataPath.c_str());
|
||||
}
|
||||
|
||||
m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0);
|
||||
m_bool_configs[CONFIG_ENABLE_MMAPS] = ConfigMgr::GetBoolDefault("mmap.enablePathFinding", true);
|
||||
sLog->outString("WORLD: MMap data directory is: %smmaps", m_dataPath.c_str());
|
||||
|
||||
m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0);
|
||||
bool enableIndoor = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", true);
|
||||
bool enableLOS = ConfigMgr::GetBoolDefault("vmap.enableLOS", true);
|
||||
bool enableHeight = ConfigMgr::GetBoolDefault("vmap.enableHeight", true);
|
||||
|
||||
Reference in New Issue
Block a user