diff options
| author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-08-15 14:05:13 +0200 |
|---|---|---|
| committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-08-15 14:09:20 +0200 |
| commit | b560090692d6b278c232fd3e4ec9f4f140977fa1 (patch) | |
| tree | bbc63382f37ed2114caa1de921cb703599b269e1 /src/server/game/Entities/GameObject | |
| parent | 69b7115b9adcc45078120e24e341db72460ad643 (diff) | |
Core/GameObject: Fix interaction distance with GameObjects in all corner cases by overriding Object:_IsWithinDist. Distance calculation to GO's need to take in account GameObjectDisplayInfoDBC entries, otherwise distance would not be calculated from the edges properly and ie. quest interaction with large gameobjects would fail.
Diffstat (limited to 'src/server/game/Entities/GameObject')
| -rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.h | 7 |
1 files changed, 7 insertions, 0 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 |
