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

@@ -20,6 +20,7 @@
#include "Define.h"
#include "ObjectGuid.h"
#include "WaypointDefines.h"
#include <map>
#include <string>
#include <unordered_map>
@@ -27,22 +28,6 @@
class WorldObject;
enum SpellEffIndex : uint8;
struct WayPoint
{
WayPoint(uint32 _id, float _x, float _y, float _z)
{
id = _id;
x = _x;
y = _y;
z = _z;
}
uint32 id;
float x;
float y;
float z;
};
enum eSmartAI
{
SMART_EVENT_PARAM_COUNT = 4,
@@ -1546,8 +1531,6 @@ struct SmartScriptHolder
operator bool() const { return entryOrGuid != 0; }
};
typedef std::unordered_map<uint32, WayPoint*> WPPath;
typedef std::vector<WorldObject*> ObjectVector;
class ObjectGuidVector
@@ -1574,26 +1557,22 @@ typedef std::unordered_map<uint32, ObjectGuidVector> ObjectVectorMap;
class TC_GAME_API SmartWaypointMgr
{
private:
SmartWaypointMgr() { }
~SmartWaypointMgr();
public:
static SmartWaypointMgr* instance();
void LoadFromDB();
WPPath* GetPath(uint32 id)
{
if (waypoint_map.find(id) != waypoint_map.end())
return waypoint_map[id];
else return nullptr;
}
WaypointPath const* GetPath(uint32 id);
private:
std::unordered_map<uint32, WPPath*> waypoint_map;
SmartWaypointMgr() { }
~SmartWaypointMgr() { }
std::unordered_map<uint32, WaypointPath> _waypointStore;
};
#define sSmartWaypointMgr SmartWaypointMgr::instance()
// all events for a single entry
typedef std::vector<SmartScriptHolder> SmartAIEventList;
typedef std::vector<SmartScriptHolder> SmartAIEventStoredList;
@@ -1662,5 +1641,4 @@ class TC_GAME_API SmartAIMgr
};
#define sSmartScriptMgr SmartAIMgr::instance()
#define sSmartWaypointMgr SmartWaypointMgr::instance()
#endif