[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:
gvcoman
2008-11-14 20:40:35 -06:00
parent 3085e66b96
commit 5deef1bb59
21 changed files with 329 additions and 74 deletions

View File

@@ -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)