diff options
| author | treeston <treeston.mmoc@gmail.com> | 2017-06-10 15:08:35 +0200 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2017-06-10 15:08:35 +0200 |
| commit | d57307f63d8deb51003d61163adccce4e2c1bd47 (patch) | |
| tree | 16c3eeac40a43fe0898609d9051c4ad8c0b8e102 /src/server/game/Maps/Map.cpp | |
| parent | 9e80e977df56834d4cdc76a57a417a86a1dbda65 (diff) | |
So, I came in trying to fix gameobject LoS. So I restructured some stuff.
Then it turned out that gameobject LoS is already fixed. So all this does, really, is restructure some stuff.
And remove the hack from Sapphiron because I could.
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 41e8129889f..2e956616e09 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2713,10 +2713,15 @@ float Map::GetWaterLevel(float x, float y) const return 0; } -bool Map::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, VMAP::ModelIgnoreFlags ignoreFlags) const +bool Map::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const { - return VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2, ignoreFlags) - && _dynamicTree.isInLineOfSight(x1, y1, z1, x2, y2, z2, phasemask); + if ((checks & LINEOFSIGHT_CHECK_VMAP) + && !VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2, ignoreFlags)) + return false; + if (sWorld->getBoolConfig(CONFIG_CHECK_GOBJECT_LOS) && (checks & LINEOFSIGHT_CHECK_GOBJECT) + && !_dynamicTree.isInLineOfSight(x1, y1, z1, x2, y2, z2, phasemask)) + return false; + return true; } bool Map::getObjectHitPos(uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float& ry, float& rz, float modifyDist) |
