aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/Notifiers
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-09-04 22:01:25 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-05 12:04:35 +0100
commitd561a691220c2c0856f63ff6cbcd4d0af8c761d5 (patch)
tree715a20928ae10e5487da34435bbf1f4e52673641 /src/server/game/Grids/Notifiers
parent4dff5bd09b73c0a02cf8a95f9e4f528e74a5ef50 (diff)
Scripts/Obsidian Sanctum: Fix portals not being visible
Change NearestGameObjectEntryInObjectRangeCheck to allow returning GameObject not spawned. Fixes other occurrences where a similar issue exists. (cherry picked from commit ca2159bf405fb96a8eba9f1e58bda7ee6c7eb247)
Diffstat (limited to 'src/server/game/Grids/Notifiers')
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index bff2785ca1f..bd8bcbe6c07 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -794,11 +794,11 @@ namespace Trinity
class NearestGameObjectEntryInObjectRangeCheck
{
public:
- NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) { }
+ NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range, bool spawnedOnly = true) : i_obj(obj), i_entry(entry), i_range(range), i_spawnedOnly(spawnedOnly) { }
bool operator()(GameObject* go)
{
- if (go->isSpawned() && go->GetEntry() == i_entry && go->GetGUID() != i_obj.GetGUID() && i_obj.IsWithinDistInMap(go, i_range))
+ if ((!i_spawnedOnly || go->isSpawned()) && go->GetEntry() == i_entry && go->GetGUID() != i_obj.GetGUID() && i_obj.IsWithinDistInMap(go, i_range))
{
i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
return true;
@@ -810,6 +810,7 @@ namespace Trinity
WorldObject const& i_obj;
uint32 i_entry;
float i_range;
+ bool i_spawnedOnly;
// prevent clone this object
NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&) = delete;