*Update relocation notify code. Only notify units within max visible distance.

*Delete a duplicated config option.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-19 23:31:02 -06:00
parent d7c37e157a
commit ac9e2ac6d2
5 changed files with 24 additions and 33 deletions

View File

@@ -656,12 +656,22 @@ void Map::Update(const uint32 &t_diff)
unit->m_Notified = true;
if(!unit->IsInWorld())
continue;
CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
Cell cell(val);
//CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
//Cell cell(val);
//if(unit->GetTypeId() == TYPEID_PLAYER)
// PlayerRelocationNotify((Player*)unit, cell, val);
//else
// CreatureRelocationNotify((Creature*)unit, cell, val);
if(unit->GetTypeId() == TYPEID_PLAYER)
PlayerRelocationNotify((Player*)unit, cell, val);
{
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
}
else
CreatureRelocationNotify((Creature*)unit, cell, val);
{
Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit));
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
}
}
for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{