aboutsummaryrefslogtreecommitdiff
path: root/src/game/WaypointManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/WaypointManager.cpp')
-rw-r--r--src/game/WaypointManager.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index fb59b0bddbd..814cc28609f 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -106,7 +106,7 @@ void WaypointStore::UpdatePath(uint32 id)
QueryResult_AutoPtr result;
- result = WorldDatabase.PQuery("SELECT id,point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id);
+ result = WorldDatabase.PQuery("SELECT point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id);
if (!result)
return;
@@ -118,26 +118,25 @@ void WaypointStore::UpdatePath(uint32 id)
do
{
fields = result->Fetch();
- uint32 id = fields[0].GetUInt32();
WaypointData *wp = new WaypointData;
float x,y,z;
- x = fields[2].GetFloat();
- y = fields[3].GetFloat();
- z = fields[4].GetFloat();
+ x = fields[1].GetFloat();
+ y = fields[2].GetFloat();
+ z = fields[3].GetFloat();
Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
- wp->id = fields[1].GetUInt32();
+ wp->id = fields[0].GetUInt32();
wp->x = x;
wp->y = y;
wp->z = z;
- wp->run = fields[5].GetBool();
- wp->delay = fields[6].GetUInt32();
- wp->event_id = fields[7].GetUInt32();
- wp->event_chance = fields[8].GetUInt8();
+ wp->run = fields[4].GetBool();
+ wp->delay = fields[5].GetUInt32();
+ wp->event_id = fields[6].GetUInt32();
+ wp->event_chance = fields[7].GetUInt8();
path_data->push_back(wp);