diff options
| author | HelloKitty <andrew.blakely@ymail.com> | 2017-01-21 14:44:31 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-01-21 14:44:31 +0100 |
| commit | 01d715eaef99e91f0959dc85fb7f69eb26d01a22 (patch) | |
| tree | 8c1c805c9eca9a0da828b4ddbf566cca4d464e84 /src/server/game/Entities/Object | |
| parent | 998efa55d8c81b923bb0725b5de8b0c5894b89da (diff) | |
Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index cc95820d97d..d90a5873f92 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1149,7 +1149,7 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool return distsq < maxdist * maxdist; } -bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const +bool WorldObject::IsWithinLOSInMap(const WorldObject* obj, VMAP::ModelIgnoreFlags ignoreFlags) const { if (!IsInMap(obj)) return false; @@ -1160,7 +1160,7 @@ bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const else obj->GetHitSpherePointFor(GetPosition(), x, y, z); - return IsWithinLOS(x, y, z); + return IsWithinLOS(x, y, z, ignoreFlags); } float WorldObject::GetDistance(const WorldObject* obj) const @@ -1237,7 +1237,7 @@ bool WorldObject::IsWithinDistInMap(WorldObject const* obj, float dist2compare, return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D); } -bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const +bool WorldObject::IsWithinLOS(float ox, float oy, float oz, VMAP::ModelIgnoreFlags ignoreFlags) const { /*float x, y, z; GetPosition(x, y, z); @@ -1251,7 +1251,7 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const else GetHitSpherePointFor({ ox, oy, oz }, x, y, z); - return GetMap()->isInLineOfSight(x, y, z + 2.0f, ox, oy, oz + 2.0f, GetPhaseMask()); + return GetMap()->isInLineOfSight(x, y, z + 2.0f, ox, oy, oz + 2.0f, GetPhaseMask(), ignoreFlags); } return true; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 018964000b5..2dfb671353a 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -25,6 +25,7 @@ #include "GridReference.h" #include "ObjectDefines.h" #include "Map.h" +#include "ModelIgnoreFlags.h" #include <set> #include <string> @@ -489,8 +490,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation // use only if you will sure about placing both object at same map bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const; bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const; - bool IsWithinLOS(float x, float y, float z) const; - bool IsWithinLOSInMap(WorldObject const* obj) const; + bool IsWithinLOS(float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags = VMAP::ModelIgnoreFlags::Nothing) const; + bool IsWithinLOSInMap(WorldObject const* obj, VMAP::ModelIgnoreFlags ignoreFlags = VMAP::ModelIgnoreFlags::Nothing) const; Position GetHitSpherePointFor(Position const& dest) const; void GetHitSpherePointFor(Position const& dest, float& x, float& y, float& z) const; bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const; |
