mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 11:52:32 +01:00
*Update relocation notify code. Only notify units within max visible distance.
*Delete a duplicated config option. --HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user