mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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 commit6d00d3f283) Merge remote-tracking branch 'Treeston/3.3.5-splinechains' into 3.3.5 (PR #17946) (cherry picked from commit20f483967f) 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 commit4fa646c0b2) 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 commit4a1a460241)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user