mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/AreaTriggers: Implementation for sever side area triggers
- Spawn GridLoader to spawn area triggers correctly now - Removed SAI completely - Removed remnants of smart scripts. Created different issue for it - Calling InitDbPhaseShift and not InDbPhaseShift - changed SpawnId to uint64 rather than uint32 - not using CellGuidSet typedef as to not include ObjectMgr.h in the header
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "ObjectGridLoader.h"
|
||||
#include "AreaTrigger.h"
|
||||
#include "AreaTriggerDataStore.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Conversation.h"
|
||||
#include "Corpse.h"
|
||||
@@ -124,7 +125,9 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
|
||||
T* obj = new T;
|
||||
|
||||
// Don't spawn at all if there's a respawn time
|
||||
if ((obj->GetTypeId() == TYPEID_UNIT && !map->GetCreatureRespawnTime(*i_guid)) || (obj->GetTypeId() == TYPEID_GAMEOBJECT && !map->GetGORespawnTime(*i_guid)))
|
||||
if ((obj->GetTypeId() == TYPEID_UNIT && !map->GetCreatureRespawnTime(*i_guid)) ||
|
||||
(obj->GetTypeId() == TYPEID_GAMEOBJECT && !map->GetGORespawnTime(*i_guid)) ||
|
||||
(obj->GetTypeId() == TYPEID_AREATRIGGER))
|
||||
{
|
||||
ObjectGuid::LowType guid = *i_guid;
|
||||
//TC_LOG_INFO("misc", "DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
|
||||
@@ -175,7 +178,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectGridLoader::Visit(GameObjectMapType &m)
|
||||
void ObjectGridLoader::Visit(GameObjectMapType& m)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetDifficultyID(), cellCoord.GetId());
|
||||
@@ -189,6 +192,15 @@ void ObjectGridLoader::Visit(CreatureMapType &m)
|
||||
LoadHelper(cell_guids.creatures, cellCoord, m, i_creatures, i_map);
|
||||
}
|
||||
|
||||
void ObjectGridLoader::Visit(AreaTriggerMapType &m)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
CellGuidSet const* areaTriggers = sAreaTriggerDataStore->GetAreaTriggersForMapAndCell(i_map->GetId(), cellCoord.GetId());
|
||||
if (!areaTriggers)
|
||||
return;
|
||||
LoadHelper(*areaTriggers, cellCoord, m, i_areaTriggers, i_map);
|
||||
}
|
||||
|
||||
void ObjectWorldLoader::Visit(CorpseMapType& /*m*/)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
|
||||
Reference in New Issue
Block a user