mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8524] New cell search algorithm implemented. You can now choose different visibility distances on continents, in BG/Arenas and instances.
Please, update your config files and check new options: Visibility.Distance.Continents = 90 Visibility.Distance.Instances = 120 Visibility.Distance.BGArenas = 180 Thanks everyone involved in patch tests! Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
81456dc416
commit
cfea99ea62
28 changed files with 434 additions and 123 deletions
|
|
@ -319,13 +319,13 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap(), *this, radius);
|
||||
|
||||
// or unfriendly player/pet
|
||||
if(!ok)
|
||||
{
|
||||
TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap(), *this, radius);
|
||||
}
|
||||
}
|
||||
else // environmental trap
|
||||
|
|
@ -340,7 +340,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap(), *this, radius);
|
||||
ok = p_ok;
|
||||
}
|
||||
|
||||
|
|
@ -784,7 +784,7 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target)
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, object_checker, *GetMap(), *target, range);
|
||||
}
|
||||
|
||||
// found correct GO
|
||||
|
|
@ -806,7 +806,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
|
@ -1031,7 +1031,8 @@ void GameObject::Use(Unit* user)
|
|||
//fish catched
|
||||
player->UpdateFishingSkill();
|
||||
|
||||
GameObject* ok = LookupFishingHoleAround(DEFAULT_VISIBILITY_DISTANCE);
|
||||
//TODO: find reasonable value for fishing hole search
|
||||
GameObject* ok = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE);
|
||||
if (ok)
|
||||
{
|
||||
player->SendLoot(ok->GetGUID(),LOOT_FISHINGHOLE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue