Core/Maps: Removed MapInstanced - no longer neccessary for grid data reference counting (moved to TerrainInfo)
This commit is contained in:
1 parent
f879d95589
commit
81b2ff0d94
33 files changed
+538
-764
No files matched your search
@@ -28,7 +28,6 @@
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameTime.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "GameObject.h"
|
||||
#include "GameTime.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
@@ -31,6 +31,7 @@ EndScriptData */
|
||||
#include "DBCStores.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
@@ -1622,14 +1623,31 @@ public:
|
||||
if (*args)
|
||||
{
|
||||
int32 mapId = atoi(args);
|
||||
map = sMapMgr->FindBaseNonInstanceMap(mapId);
|
||||
sMapMgr->DoForAllMapsWithMapId(mapId, [&](Map* map)
|
||||
{
|
||||
HandleDebugLoadCellsCommandHelper(handler, map);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!map)
|
||||
map = player->GetMap();
|
||||
{
|
||||
// Fallback to player's map if no map has been specified
|
||||
return HandleDebugLoadCellsCommandHelper(handler, player->GetMap());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleDebugLoadCellsCommandHelper(ChatHandler* handler, Map* map)
|
||||
{
|
||||
if (!map)
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage("Loading all cells (mapId: %u). Current next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
|
||||
map->LoadAllCells();
|
||||
handler->PSendSysMessage("Cells loaded (mapId: %u) After load - Next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ EndScriptData */
|
||||
#include "GameObject.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
@@ -29,6 +29,7 @@ EndScriptData */
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
@@ -32,6 +32,7 @@ EndScriptData */
|
||||
#include "GameTime.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
@@ -129,28 +130,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<uint32, Creature*>::const_iterator itr = creBounds.first; itr != creBounds.second;)
|
||||
{
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " ");
|
||||
else
|
||||
handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, 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)
|
||||
@@ -448,28 +439,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<uint32, GameObject*>::const_iterator itr = goBounds.first; itr != goBounds.second;)
|
||||
{
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->isSpawned() ? "*" : " ");
|
||||
else
|
||||
handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, 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)
|
||||
|
||||
+7
-8
@@ -16,20 +16,19 @@
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackwing_descent.h"
|
||||
#include "CommonPredicates.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "blackwing_descent.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameObject.h"
|
||||
#include "MapManager.h"
|
||||
#include "Map.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPHP.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -260,7 +260,7 @@ void OPvPCapturePointHP::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
Map* map = sMapMgr->FindMap(530, 0);
|
||||
Map* map = m_PvP->GetMap();
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
Reference in new issue
Block a user