48{
50
51
52 QueryResult result =
WorldDatabase.Query(
"SELECT id, point, position_x, position_y, position_z, orientation, move_type, delay, action, action_chance FROM waypoint_data ORDER BY id, point");
53
54 if (!result)
55 {
56 LOG_WARN(
"server.loading",
">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
58 return;
59 }
60
62
63 do
64 {
65 Field* fields = result->Fetch();
67
70
71 float x = fields[2].
Get<
float>();
72 float y = fields[3].
Get<
float>();
73 float z = fields[4].
Get<
float>();
74 std::optional<float > o;
75 if (!fields[5].IsNull())
76 o = fields[5].Get<float>();
77
80
87
89 {
90
91 delete wp;
92 continue;
93 }
94
98
99 path.push_back(wp);
100 ++count;
101 } while (result->NextRow());
102
105}
#define LOG_INFO(filterType__,...)
Definition: Log.h:165
#define LOG_WARN(filterType__,...)
Definition: Log.h:161
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
std::uint32_t uint32
Definition: Define.h:107
std::int16_t int16
Definition: Define.h:104
std::vector< WaypointData * > WaypointPath
Definition: WaypointMgr.h:47
@ WAYPOINT_MOVE_TYPE_MAX
Definition: WaypointMgr.h:33
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:27
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
void NormalizeMapCoord(float &c)
Definition: GridDefines.h:207
Class used to access individual fields of database query result.
Definition: Field.h:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:112
Definition: WaypointMgr.h:37
float z
Definition: WaypointMgr.h:39
uint32 event_id
Definition: WaypointMgr.h:42
float x
Definition: WaypointMgr.h:39
float y
Definition: WaypointMgr.h:39
std::optional< float > orientation
Definition: WaypointMgr.h:40
uint32 delay
Definition: WaypointMgr.h:41
uint8 event_chance
Definition: WaypointMgr.h:44
uint32 id
Definition: WaypointMgr.h:38
uint32 move_type
Definition: WaypointMgr.h:43