diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-14 23:53:37 +0200 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2016-09-20 00:37:36 +0200 |
commit | 6d00d3f28380dd0811a18913450b1dc4f07fef48 (patch) | |
tree | 4367f426d2c48a718cade01216e2da407fa9633f /src/server/game/Scripting/ScriptSystem.h | |
parent | 0b658f789cab005c080941e2be33e855debcbfde (diff) |
Core/Movement: Add new SplineChainMovementGenerator that allows accurate replication of sniffed waypoints in static sequences, along with DB facilities that allow loading of waypoints from DB.
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() |