mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
[svn] * Reimplemented packet/update forwarding in more generic way
* Implemented far sight spells (Far Sight, Eagle Eye, etc) at unlimited range and properly forward packets * Implemented bind vision spells (Mind Vision, etc) to forward packets at unlimited distance * Implemented Sentry Totem (both vision switching/forwarding and alerting) * Other misc possession fixes * Added .bindsight and .unbindsight commands Please test out the above spells (including Mind Control) and report any issues on the forums. --HG-- branch : trunk
This commit is contained in:
@@ -315,21 +315,29 @@ void Map::SwitchGridContainers(T* obj, bool active)
|
||||
{
|
||||
CellPair pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
Cell cell(pair);
|
||||
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
||||
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
|
||||
GridType &grid = (*ngrid)(cell.CellX(), cell.CellY());
|
||||
|
||||
if (active)
|
||||
{
|
||||
(*grid)(cell.CellX(), cell.CellY()).RemoveGridObject<T>(obj, obj->GetGUID());
|
||||
(*grid)(cell.CellX(), cell.CellY()).AddWorldObject<T>(obj, obj->GetGUID());
|
||||
if (!grid.GetWorldObject(obj->GetGUID(), obj))
|
||||
{
|
||||
grid.RemoveGridObject<T>(obj, obj->GetGUID());
|
||||
grid.AddWorldObject<T>(obj, obj->GetGUID());
|
||||
}
|
||||
} else
|
||||
{
|
||||
(*grid)(cell.CellX(), cell.CellY()).RemoveWorldObject<T>(obj, obj->GetGUID());
|
||||
(*grid)(cell.CellX(), cell.CellY()).AddGridObject<T>(obj, obj->GetGUID());
|
||||
if (!grid.GetGridObject(obj->GetGUID(), obj))
|
||||
{
|
||||
grid.RemoveWorldObject<T>(obj, obj->GetGUID());
|
||||
grid.AddGridObject<T>(obj, obj->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template void Map::SwitchGridContainers(Creature *, bool);
|
||||
template void Map::SwitchGridContainers(Corpse *, bool);
|
||||
template void Map::SwitchGridContainers(DynamicObject *, bool);
|
||||
|
||||
template<class T>
|
||||
void Map::DeleteFromWorld(T* obj)
|
||||
|
||||
Reference in New Issue
Block a user