diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-14 23:53:37 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-03-01 22:03:35 +0100 |
commit | 59d48ce7e42a7bf68f47254de518780631572545 (patch) | |
tree | d1c673ae3c6a98e9d58e3051c257ec350d2bc056 /src/server/game/Scripting/ScriptSystem.h | |
parent | 9aa4b6d10f638160cf2bd8bad61b62296efdc490 (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.
(cherry picked from commit 6d00d3f28380dd0811a18913450b1dc4f07fef48)
Merge remote-tracking branch 'Treeston/3.3.5-splinechains' into 3.3.5 (PR #17946)
(cherry picked from commit 20f483967fb3a430fbd54148c08b6d8e8937daac)
Core/Movement: Add a convenience default ctor to SplineChainResumeInfo, and fix PCH build in some configurations (zzz why do we even keep Appveyor and Travis around).
(cherry picked from commit 4fa646c0b2ae3261e7fab249f4177900d4c8d013)
PCH build fix. Again.
(( Alright, you made me waste 20 minutes of my life on a full nonPCH rebuild of the core now. ))
(( I hope you're happy. ))
(cherry picked from commit 4a1a460241acf511467decd92d2a30e19927d74d)
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 b28b31a8b85..6086b10e2be 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -20,6 +20,9 @@ #define SC_SYSTEM_H #include "ScriptMgr.h" +#include "SplineChain.h" + +class Creature; #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available @@ -72,22 +75,32 @@ 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; + 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() |