mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
@@ -44,6 +44,20 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectGridEvacuator::Visit(GameObjectMapType &m)
|
||||
{
|
||||
// gameobject in unloading grid can have respawn point in another grid
|
||||
// if it will be unloaded then it will not respawn in original grid until unload/load original grid
|
||||
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
|
||||
for (GameObjectMapType::iterator iter = m.begin(); iter != m.end();)
|
||||
{
|
||||
GameObject* go = iter->GetSource();
|
||||
++iter;
|
||||
|
||||
go->GetMap()->GameObjectRespawnRelocation(go, true);
|
||||
}
|
||||
}
|
||||
|
||||
// for loading world object at grid loading (Corpses)
|
||||
/// @todo to implement npc on transport, also need to load npcs at grid loading
|
||||
class ObjectWorldLoader
|
||||
@@ -71,12 +85,26 @@ template<class T> void ObjectGridLoader::SetObjectCell(T* /*obj*/, CellCoord con
|
||||
template<> void ObjectGridLoader::SetObjectCell(Creature* obj, CellCoord const& cellCoord)
|
||||
{
|
||||
Cell cell(cellCoord);
|
||||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
|
||||
template<> void ObjectGridLoader::SetObjectCell(GameObject* obj, CellCoord const& cellCoord)
|
||||
{
|
||||
Cell cell(cellCoord);
|
||||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void AddObjectHelper(CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)
|
||||
void AddObjectHelper(CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map* /*map*/, T *obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
obj->AddToWorld();
|
||||
++count;
|
||||
}
|
||||
|
||||
template <>
|
||||
void AddObjectHelper(CellCoord &cell, CreatureMapType &m, uint32 &count, Map* map, Creature *obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
|
||||
Reference in New Issue
Block a user