aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-09-04 22:01:25 +0200
committerjackpoz <giacomopoz@gmail.com>2020-09-04 22:01:25 +0200
commitca2159bf405fb96a8eba9f1e58bda7ee6c7eb247 (patch)
tree272074de48093474e53d2a25a4a50632c3789463 /src/server/game/Grids
parenta58aeb41f466fd916cdc12e805f7a8130c8ccdf5 (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.
Diffstat (limited to 'src/server/game/Grids')
-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 0b8c45051ed..b116760c411 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -736,11 +736,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;
@@ -752,6 +752,7 @@ namespace Trinity
WorldObject const& i_obj;
uint32 i_entry;
float i_range;
+ bool i_spawnedOnly;
// prevent clone this object
NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&) = delete;