mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/MMaps: Remove phased tile support
* Extremely slow * Needs to be implemented partially in tools * Conflicts with upcoming phasing rewrite
This commit is contained in:
@@ -43,8 +43,8 @@ PathGenerator::PathGenerator(const Unit* owner) :
|
||||
if (DisableMgr::IsPathfindingEnabled(mapId))
|
||||
{
|
||||
MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
_navMesh = mmap->GetNavMesh(mapId, _sourceUnit->GetTerrainSwaps());
|
||||
_navMeshQuery = mmap->GetNavMeshQuery(mapId, _sourceUnit->GetInstanceId(), _sourceUnit->GetTerrainSwaps());
|
||||
_navMesh = mmap->GetNavMesh(mapId);
|
||||
_navMeshQuery = mmap->GetNavMeshQuery(mapId, _sourceUnit->GetInstanceId());
|
||||
}
|
||||
|
||||
CreateFilter();
|
||||
|
||||
@@ -1502,19 +1502,15 @@ void World::SetInitialWorldSettings()
|
||||
// Load M2 fly by cameras
|
||||
LoadM2Cameras(m_dataPath);
|
||||
|
||||
std::unordered_map<uint32, std::vector<uint32>> mapData;
|
||||
std::vector<uint32> mapIds;
|
||||
for (MapEntry const* mapEntry : sMapStore)
|
||||
{
|
||||
mapData.insert(std::unordered_map<uint32, std::vector<uint32>>::value_type(mapEntry->MapID, std::vector<uint32>()));
|
||||
if (mapEntry->rootPhaseMap != -1)
|
||||
mapData[mapEntry->rootPhaseMap].push_back(mapEntry->MapID);
|
||||
}
|
||||
mapIds.push_back(mapEntry->ID);
|
||||
|
||||
if (VMAP::VMapManager2* vmmgr2 = dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager()))
|
||||
vmmgr2->InitializeThreadUnsafe(mapData);
|
||||
vmmgr2->InitializeThreadUnsafe(mapIds);
|
||||
|
||||
MMAP::MMapManager* mmmgr = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
mmmgr->InitializeThreadUnsafe(mapData);
|
||||
mmmgr->InitializeThreadUnsafe(mapIds);
|
||||
|
||||
TC_LOG_INFO("server.loading", "Initializing PlayerDump tables...");
|
||||
PlayerDump::InitializeTables();
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
|
||||
uint32 haveMap = Map::ExistMap(mapId, gridX, gridY) ? 1 : 0;
|
||||
uint32 haveVMap = Map::ExistVMap(mapId, gridX, gridY) ? 1 : 0;
|
||||
uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps())) ? 1 : 0;
|
||||
uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0;
|
||||
|
||||
if (haveVMap)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
static bool HandleMmapPathCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps()))
|
||||
if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
return true;
|
||||
@@ -134,8 +134,8 @@ public:
|
||||
handler->PSendSysMessage("gridloc [%i, %i]", gy, gx);
|
||||
|
||||
// calculate navmesh tile location
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId());
|
||||
if (!navmesh || !navmeshquery)
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
@@ -186,8 +186,8 @@ public:
|
||||
static bool HandleMmapLoadedTilesCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
uint32 mapid = handler->GetSession()->GetPlayer()->GetMapId();
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(mapid, handler->GetSession()->GetPlayer()->GetTerrainSwaps());
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(mapid);
|
||||
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId());
|
||||
if (!navmesh || !navmeshquery)
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount());
|
||||
|
||||
dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
|
||||
dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
if (!navmesh)
|
||||
{
|
||||
handler->PSendSysMessage("NavMesh not loaded for current map.");
|
||||
|
||||
Reference in New Issue
Block a user