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/common/Collision/Management | |
| parent | 998efa55d8c81b923bb0725b5de8b0c5894b89da (diff) | |
Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528
Diffstat (limited to 'src/common/Collision/Management')
| -rw-r--r-- | src/common/Collision/Management/IVMapManager.h | 3 | ||||
| -rw-r--r-- | src/common/Collision/Management/VMapManager2.cpp | 9 | ||||
| -rw-r--r-- | src/common/Collision/Management/VMapManager2.h | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/common/Collision/Management/IVMapManager.h b/src/common/Collision/Management/IVMapManager.h index 8d18463788e..a28f45c349f 100644 --- a/src/common/Collision/Management/IVMapManager.h +++ b/src/common/Collision/Management/IVMapManager.h @@ -21,6 +21,7 @@ #include <string> #include "Define.h" +#include "ModelIgnoreFlags.h" //=========================================================== @@ -60,7 +61,7 @@ namespace VMAP virtual void unloadMap(unsigned int pMapId, int x, int y) = 0; virtual void unloadMap(unsigned int pMapId) = 0; - virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0; + virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) = 0; virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) = 0; /** test if we hit an object. return true if we hit one. rx, ry, rz will hold the hit position or the dest position, if no intersection was found diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index 4db878a117f..74d6c734053 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -162,7 +162,7 @@ namespace VMAP } } - bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) + bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) { if (!isLineOfSightCalcEnabled() || IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LOS)) return true; @@ -174,7 +174,7 @@ namespace VMAP Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2); if (pos1 != pos2) { - return instanceTree->second->isInLineOfSight(pos1, pos2); + return instanceTree->second->isInLineOfSight(pos1, pos2, ignoreFlags); } } @@ -279,7 +279,7 @@ namespace VMAP return false; } - WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename) + WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags/* Only used when creating the model */) { //! Critical section, thread safe access to iLoadedModelFiles std::lock_guard<std::mutex> lock(LoadedModelFilesLock); @@ -295,6 +295,9 @@ namespace VMAP return NULL; } VMAP_DEBUG_LOG("maps", "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); + + worldmodel->Flags = flags; + model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first; model->second.setModel(worldmodel); } diff --git a/src/common/Collision/Management/VMapManager2.h b/src/common/Collision/Management/VMapManager2.h index f7b861d21a4..593f046412e 100644 --- a/src/common/Collision/Management/VMapManager2.h +++ b/src/common/Collision/Management/VMapManager2.h @@ -107,7 +107,7 @@ namespace VMAP void unloadMap(unsigned int mapId, int x, int y) override; void unloadMap(unsigned int mapId) override; - bool isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) override ; + bool isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) override ; /** fill the hit pos and return true, if an object was hit */ @@ -119,7 +119,7 @@ namespace VMAP bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const override; bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const override; - WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename); + WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags = 0); void releaseModelInstance(const std::string& filename); // what's the use of this? o.O |
