Revert "Core/Movement: merged smooth waypoints (commit: 05fb27dae4e8af859e01e5b9e52b082cba217657)"

This reverts commit 6dddfc812c.
This commit is contained in:
Ovahlord committed 2018-03-27 22:04:30 +02:00
1 parent d2b2dc8fca
commit 53e989dcd3
16 files changed
+630 -606

No files matched your search

@@ -24,6 +24,19 @@
WaypointMgr::WaypointMgr() { }
WaypointMgr::~WaypointMgr()
{
for (WaypointPathContainer::iterator itr = _waypointStore.begin(); itr != _waypointStore.end(); ++itr)
{
for (WaypointPath::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
delete *it;
itr->second.clear();
}
_waypointStore.clear();
}
void WaypointMgr::Load()
{
uint32 oldMSTime = getMSTime();
@@ -42,6 +55,7 @@ void WaypointMgr::Load()
do
{
Field* fields = result->Fetch();
WaypointData* wp = new WaypointData();
uint32 pathId = fields[0].GetUInt32();
WaypointPath& path = _waypointStore[pathId];
@@ -54,25 +68,25 @@ void WaypointMgr::Load()
Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
WaypointNode wp;
wp.id = fields[1].GetUInt32();
wp.x = x;
wp.y = y;
wp.z = z;
wp.orientation = o;
wp.moveType = fields[6].GetUInt32();
wp->id = fields[1].GetUInt32();
wp->x = x;
wp->y = y;
wp->z = z;
wp->orientation = o;
wp->move_type = fields[6].GetUInt32();
if (wp.moveType >= WAYPOINT_MOVE_TYPE_MAX)
if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp.id);
TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp->id);
delete wp;
continue;
}
wp.delay = fields[7].GetUInt32();
wp.eventId = fields[8].GetUInt32();
wp.eventChance = fields[9].GetInt16();
wp->delay = fields[7].GetUInt32();
wp->event_id = fields[8].GetUInt32();
wp->event_chance = fields[9].GetInt16();
path.nodes.push_back(std::move(wp));
path.push_back(wp);
++count;
}
while (result->NextRow());
@@ -91,6 +105,9 @@ void WaypointMgr::ReloadPath(uint32 id)
WaypointPathContainer::iterator itr = _waypointStore.find(id);
if (itr != _waypointStore.end())
{
for (WaypointPath::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
delete *it;
_waypointStore.erase(itr);
}
@@ -108,6 +125,7 @@ void WaypointMgr::ReloadPath(uint32 id)
do
{
Field* fields = result->Fetch();
WaypointData* wp = new WaypointData();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
@@ -117,25 +135,25 @@ void WaypointMgr::ReloadPath(uint32 id)
Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
WaypointNode wp;
wp.id = fields[0].GetUInt32();
wp.x = x;
wp.y = y;
wp.z = z;
wp.orientation = o;
wp.moveType = fields[5].GetUInt32();
wp->id = fields[0].GetUInt32();
wp->x = x;
wp->y = y;
wp->z = z;
wp->orientation = o;
wp->move_type = fields[5].GetUInt32();
if (wp.moveType >= WAYPOINT_MOVE_TYPE_MAX)
if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp.id);
TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp->id);
delete wp;
continue;
}
wp.delay = fields[6].GetUInt32();
wp.eventId = fields[7].GetUInt32();
wp.eventChance = fields[8].GetUInt8();
wp->delay = fields[6].GetUInt32();
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();
path.nodes.push_back(std::move(wp));
path.push_back(wp);
}
while (result->NextRow());