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.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index e9455269a13..6e303ca3053 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -41,10 +41,10 @@ void WaypointStore::Load()
exit(1); // Stop server at loading non exited table or not accessable table
}
- records = (*result)[0].GetUInt32();
+ records = (*result)[0].GetUInt32();
delete result;
- result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`");
+ result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`");
if(!result)
{
sLog.outErrorDb("The table `creature_addon` is empty or corrupted");
@@ -54,21 +54,21 @@ void WaypointStore::Load()
WaypointPath* path_data;
uint32 total_records = result->GetRowCount();
- barGoLink bar( total_records);
+ barGoLink bar( total_records);
Field *fields;
uint32 last_id = 0;
- do
+ do
{
fields = result->Fetch();
uint32 id = fields[0].GetUInt32();
bar.step();
WaypointData *wp = new WaypointData;
- if(last_id != id)
- path_data = new WaypointPath;
+ if(last_id != id)
+ path_data = new WaypointPath;
- float x,y,z;
+ float x,y,z;
x = fields[2].GetFloat();
y = fields[3].GetFloat();
z = fields[4].GetFloat();
@@ -85,14 +85,14 @@ void WaypointStore::Load()
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();
- path_data->push_back(wp);
+ path_data->push_back(wp);
- if(id != last_id)
- waypoint_map[id] = path_data;
+ if(id != last_id)
+ waypoint_map[id] = path_data;
- last_id = id;
+ last_id = id;
- } while(result->NextRow()) ;
+ } while(result->NextRow()) ;
delete result;
@@ -101,35 +101,35 @@ void WaypointStore::Load()
void WaypointStore::UpdatePath(uint32 id)
{
- if(waypoint_map.find(id)!= waypoint_map.end())
- waypoint_map[id]->clear();
+ if(waypoint_map.find(id)!= waypoint_map.end())
+ waypoint_map[id]->clear();
- QueryResult *result;
+ QueryResult *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);
- if(!result)
- return;
+ if(!result)
+ return;
- WaypointPath* path_data;
+ WaypointPath* path_data;
- path_data = new WaypointPath;
+ path_data = new WaypointPath;
- Field *fields;
+ Field *fields;
- do
+ do
{
- fields = result->Fetch();
+ fields = result->Fetch();
uint32 id = fields[0].GetUInt32();
WaypointData *wp = new WaypointData;
- float x,y,z;
+ float x,y,z;
x = fields[2].GetFloat();
y = fields[3].GetFloat();
z = fields[4].GetFloat();
- Trinity::NormalizeMapCoord(x);
+ Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
wp->id = fields[1].GetUInt32();
@@ -141,11 +141,11 @@ void WaypointStore::UpdatePath(uint32 id)
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();
- path_data->push_back(wp);
+ path_data->push_back(wp);
- }while (result->NextRow());
+ }while (result->NextRow());
- waypoint_map[id] = path_data;
+ waypoint_map[id] = path_data;
- delete result;
+ delete result;
}