Core/Movement: merged smooth waypoint movement. Followup commits will be merged soon (tm)

This commit is contained in:
Ovahlord committed 2018-08-02 15:38:35 +02:00
1 parent d59a20701e
commit c808b981f7
88 files changed
+1301 -1396

No files matched your search

+8 -29
View File
@@ -21,55 +21,34 @@
#include "Define.h"
#include "Hash.h"
#include "WaypointDefines.h"
#include <unordered_map>
#include <vector>
class Creature;
struct SplineChainLink;
struct ScriptPointMove
{
uint32 uiCreatureEntry;
uint32 uiPointId;
float fX;
float fY;
float fZ;
uint32 uiWaitTime;
};
typedef std::vector<ScriptPointMove> ScriptPointVector;
class TC_GAME_API SystemMgr
{
private:
SystemMgr();
~SystemMgr();
public:
static SystemMgr* instance();
typedef std::unordered_map<uint32, ScriptPointVector> PointMoveMap;
//Database
// database
void LoadScriptWaypoints();
void LoadScriptSplineChains();
ScriptPointVector const* GetPointMoveList(uint32 creatureEntry) const
{
PointMoveMap::const_iterator itr = m_mPointMoveMap.find(creatureEntry);
if (itr == m_mPointMoveMap.end())
return nullptr;
return &itr->second;
}
WaypointPath const* GetPath(uint32 creatureEntry) const;
std::vector<SplineChainLink> const* GetSplineChain(uint32 entry, uint16 chainId) const;
std::vector<SplineChainLink> const* GetSplineChain(Creature const* who, uint16 id) const;
protected:
PointMoveMap m_mPointMoveMap; //coordinates for waypoints
typedef std::pair<uint32, uint16> ChainKeyType; // creature entry + chain ID
SystemMgr();
~SystemMgr();
std::unordered_map<uint32, WaypointPath> _waypointStore;
std::unordered_map<ChainKeyType, std::vector<SplineChainLink>> m_mSplineChainsMap; // spline chains
};