mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 21:32:52 +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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user