mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Maps: Removed MapInstanced - no longer neccessary for grid data reference counting (moved to TerrainInfo)
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameTime.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "GameObject.h"
|
||||
#include "GameTime.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
|
||||
@@ -37,6 +37,7 @@ EndScriptData */
|
||||
#include "DB2Stores.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
@@ -1233,17 +1234,26 @@ public:
|
||||
|
||||
static bool HandleDebugLoadCellsCommand(ChatHandler* handler, Optional<uint32> mapId, Optional<uint32> tileX, Optional<uint32> tileY)
|
||||
{
|
||||
Map* map = nullptr;
|
||||
if (mapId)
|
||||
{
|
||||
map = sMapMgr->FindBaseNonInstanceMap(*mapId);
|
||||
}
|
||||
else if (Player* player = handler->GetPlayer())
|
||||
{
|
||||
// Fallback to player's map if no map has been specified
|
||||
map = player->GetMap();
|
||||
sMapMgr->DoForAllMapsWithMapId(*mapId, [&](Map* map)
|
||||
{
|
||||
HandleDebugLoadCellsCommandHelper(handler, map, tileX, tileY);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Player* player = handler->GetPlayer())
|
||||
{
|
||||
// Fallback to player's map if no map has been specified
|
||||
return HandleDebugLoadCellsCommandHelper(handler, player->GetMap(), tileX, tileY);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleDebugLoadCellsCommandHelper(ChatHandler* handler, Map* map, Optional<uint32> tileX, Optional<uint32> tileY)
|
||||
{
|
||||
if (!map)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ EndScriptData */
|
||||
#include "GameTime.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
@@ -31,6 +31,7 @@ EndScriptData */
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
|
||||
@@ -32,7 +32,7 @@ EndScriptData */
|
||||
#include "GameObject.h"
|
||||
#include "GameTime.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
@@ -120,28 +120,18 @@ public:
|
||||
bool liveFound = false;
|
||||
|
||||
// Get map (only support base map from console)
|
||||
Map* thisMap;
|
||||
Map* thisMap = nullptr;
|
||||
if (handler->GetSession())
|
||||
thisMap = handler->GetSession()->GetPlayer()->GetMap();
|
||||
else
|
||||
thisMap = sMapMgr->FindBaseNonInstanceMap(mapId);
|
||||
|
||||
// If map found, try to find active version of this creature
|
||||
if (thisMap)
|
||||
{
|
||||
auto const creBounds = thisMap->GetCreatureBySpawnIdStore().equal_range(guid);
|
||||
if (creBounds.first != creBounds.second)
|
||||
{
|
||||
for (std::unordered_multimap<ObjectGuid::LowType, Creature*>::const_iterator itr = creBounds.first; itr != creBounds.second;)
|
||||
{
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, std::to_string(guid).c_str(), std::to_string(guid).c_str(), cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " ");
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, std::to_string(guid).c_str(), cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " ");
|
||||
++itr;
|
||||
}
|
||||
liveFound = true;
|
||||
}
|
||||
auto const creBounds = Trinity::Containers::MapEqualRange(thisMap->GetCreatureBySpawnIdStore(), guid);
|
||||
for (auto& [spawnId, creature] : creBounds)
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, std::to_string(guid).c_str(), std::to_string(guid).c_str(), cInfo->Name.c_str(),
|
||||
x, y, z, mapId, creature->GetGUID().ToString().c_str(), creature->IsAlive() ? "*" : " ");
|
||||
liveFound = creBounds.begin() != creBounds.end();
|
||||
}
|
||||
|
||||
if (!liveFound)
|
||||
@@ -401,28 +391,18 @@ public:
|
||||
bool liveFound = false;
|
||||
|
||||
// Get map (only support base map from console)
|
||||
Map* thisMap;
|
||||
Map* thisMap = nullptr;
|
||||
if (handler->GetSession())
|
||||
thisMap = handler->GetSession()->GetPlayer()->GetMap();
|
||||
else
|
||||
thisMap = sMapMgr->FindBaseNonInstanceMap(mapId);
|
||||
|
||||
// If map found, try to find active version of this object
|
||||
if (thisMap)
|
||||
{
|
||||
auto const goBounds = thisMap->GetGameObjectBySpawnIdStore().equal_range(guid);
|
||||
if (goBounds.first != goBounds.second)
|
||||
{
|
||||
for (std::unordered_multimap<ObjectGuid::LowType, GameObject*>::const_iterator itr = goBounds.first; itr != goBounds.second;)
|
||||
{
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CHAT, std::to_string(guid).c_str(), entry, std::to_string(guid).c_str(), gInfo->name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->isSpawned() ? "*" : " ");
|
||||
else
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, std::to_string(guid).c_str(), gInfo->name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->isSpawned() ? "*" : " ");
|
||||
++itr;
|
||||
}
|
||||
liveFound = true;
|
||||
}
|
||||
auto const goBounds = Trinity::Containers::MapEqualRange(thisMap->GetGameObjectBySpawnIdStore(), guid);
|
||||
for (auto& [spawnId, go] : goBounds)
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CHAT, std::to_string(guid).c_str(), entry, std::to_string(guid).c_str(), gInfo->name.c_str(), x, y, z, mapId,
|
||||
go->GetGUID().ToString().c_str(), go->isSpawned() ? "*" : " ");
|
||||
liveFound = goBounds.begin() != goBounds.end();
|
||||
}
|
||||
|
||||
if (!liveFound)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MapManager.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "OutdoorPvPHP.h"
|
||||
#include "GameObject.h"
|
||||
#include "MapManager.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "WorldStatePackets.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "GossipDef.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
|
||||
Reference in New Issue
Block a user