feat(DB/points_of_interest): Improved points_of_interest table, close #1193 (#2348)

This commit is contained in:
Stefano Borzì
2019-10-23 07:48:46 +02:00
committed by Stoabrogga
parent 6cac3f881f
commit 9dd623e061
5 changed files with 30 additions and 27 deletions

View File

@@ -374,7 +374,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
if (locale == LOCALE_enUS)
continue;
AddLocaleString(Name, locale, data.IconName);
AddLocaleString(Name, locale, data.Name);
} while (result->NextRow());
@@ -7148,7 +7148,7 @@ void ObjectMgr::LoadPointsOfInterest()
uint32 count = 0;
// 0 1 2 3 4 5 6
QueryResult result = WorldDatabase.Query("SELECT ID, PositionX, PositionY, Icon, Flags, Data, Name FROM points_of_interest");
QueryResult result = WorldDatabase.Query("SELECT ID, PositionX, PositionY, Icon, Flags, Importance, Name FROM points_of_interest");
if (!result)
{
@@ -7164,17 +7164,17 @@ void ObjectMgr::LoadPointsOfInterest()
uint32 point_id = fields[0].GetUInt32();
PointOfInterest POI;
POI.entry = point_id;
POI.x = fields[1].GetFloat();
POI.y = fields[2].GetFloat();
POI.icon = fields[3].GetUInt32();
POI.flags = fields[4].GetUInt32();
POI.data = fields[5].GetUInt32();
POI.icon_name = fields[6].GetString();
POI.ID = point_id;
POI.PositionX = fields[1].GetFloat();
POI.PositionY = fields[2].GetFloat();
POI.Icon = fields[3].GetUInt32();
POI.Flags = fields[4].GetUInt32();
POI.Importance = fields[5].GetUInt32();
POI.Name = fields[6].GetString();
if (!Trinity::IsValidMapCoord(POI.x, POI.y))
if (!Trinity::IsValidMapCoord(POI.PositionX, POI.PositionY))
{
sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
sLog->outErrorDb("Table `points_of_interest` (ID: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
continue;
}