diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-20 12:02:25 +0200 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2016-09-20 12:02:25 +0200 |
commit | 20f483967fb3a430fbd54148c08b6d8e8937daac (patch) | |
tree | 7404f57a21f6897c566163888d2176961e04c83b /src/server/game/Scripting/ScriptSystem.h | |
parent | 7bce4d12a6ec7d5073ad466836a3af3845419a39 (diff) | |
parent | 6d00d3f28380dd0811a18913450b1dc4f07fef48 (diff) |
Merge remote-tracking branch 'Treeston/3.3.5-splinechains' into 3.3.5 (PR #17946)
Diffstat (limited to 'src/server/game/Scripting/ScriptSystem.h')
-rw-r--r-- | src/server/game/Scripting/ScriptSystem.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index 7cf8ffc85b0..2595fd093aa 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -58,22 +58,35 @@ class TC_GAME_API SystemMgr //Database void LoadScriptWaypoints(); + void LoadScriptSplineChains(); - ScriptPointVector const& GetPointMoveList(uint32 creatureEntry) const + ScriptPointVector const* GetPointMoveList(uint32 creatureEntry) const { PointMoveMap::const_iterator itr = m_mPointMoveMap.find(creatureEntry); if (itr == m_mPointMoveMap.end()) - return _empty; + return nullptr; - return itr->second; + return &itr->second; + } + + SplineChain const* GetSplineChain(uint32 entry, uint8 id) const + { + auto it = m_mSplineChainsMap.find({ entry, id }); + if (it == m_mSplineChainsMap.end()) + return nullptr; + return &it->second; + } + + SplineChain const* GetSplineChain(Creature const* who, uint8 id) const + { + return GetSplineChain(who->GetEntry(), id); } protected: PointMoveMap m_mPointMoveMap; //coordinates for waypoints - - private: - static ScriptPointVector const _empty; + typedef std::pair<uint32, uint8> ChainKeyType; // creature entry + chain ID + std::unordered_map<ChainKeyType, SplineChain> m_mSplineChainsMap; // spline chains }; #define sScriptSystemMgr SystemMgr::instance() |