aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.h7
-rwxr-xr-xsrc/server/game/Entities/Object/Object.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 504fc37135f..a0e6fff173f 100755
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -816,6 +816,13 @@ class GameObject : public WorldObject, public GridObject<GameObject>
uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
private:
void SwitchDoorOrButton(bool activate, bool alternative = false);
+
+ //! Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size.
+ bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/) const
+ {
+ //! Following check does check 3d distance
+ return IsInRange(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), dist2compare);
+ }
GameObjectAI* m_AI;
};
#endif
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 0ec3312834d..a0433f8f475 100755
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -699,7 +699,7 @@ class WorldObject : public Object, public WorldLocation
{ return IsInDist2d(x, y, dist + GetObjectSize()); }
bool IsWithinDist2d(const Position *pos, float dist) const
{ return IsInDist2d(pos, dist + GetObjectSize()); }
- bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
+ virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
// use only if you will sure about placing both object at same map
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const
{