missing changes

This commit is contained in:
Aokromes
2017-06-19 20:34:49 +02:00
parent 1a5c0f5c3b
commit e17e5a1ba2
2 changed files with 6 additions and 5 deletions

View File

@@ -2104,7 +2104,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
// call MoveInLineOfSight for nearby creatures
Trinity::AIRelocationNotifier notifier(*summon);
summon->VisitNearbyObject(GetVisibilityRange(), notifier);
Cell::VisitAllObjects(summon, notifier, GetVisibilityRange());
return summon;
}
@@ -2267,7 +2267,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
Creature* creature = nullptr;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
VisitNearbyObject(range, searcher);
Cell::VisitAllObjects(this, searcher, range);
return creature;
}
@@ -2276,7 +2276,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
GameObject* go = nullptr;
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
Cell::VisitGridObjects(this, searcher, range);
return go;
}
@@ -2285,7 +2285,7 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float
GameObject* go = nullptr;
Trinity::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
Cell::VisitGridObjects(this, searcher, range);
return go;
}
@@ -2295,7 +2295,7 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
VisitNearbyObject(distance, searcher);
Cell::VisitWorldObjects(this, searcher, distance)
return target;
}

View File

@@ -60,6 +60,7 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
return CellArea(centerX, centerY);
}
template<class T, class CONTAINER>
inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor<T, CONTAINER>& visitor, Map& map, WorldObject const& obj, float radius) const
{
//we should increase search radius by object's radius, otherwise