diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Channel.cpp | 14 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 11 | ||||
-rw-r--r-- | src/game/WaypointManager.cpp | 19 |
3 files changed, 20 insertions, 24 deletions
diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp index 5cf46617ac2..68de32fd690 100644 --- a/src/game/Channel.cpp +++ b/src/game/Channel.cpp @@ -54,17 +54,15 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) //load not built in channel if saved std::string _name(name); CharacterDatabase.escape_string(_name); - QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT m_name, m_team, m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team); + QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team); if (result)//load { Field *fields = result->Fetch(); - const char* db_name = fields[0].GetString(); - uint32 db_team = fields[1].GetUInt32(); - m_announce = fields[2].GetBool(); - m_moderate = fields[3].GetBool(); - m_public = fields[4].GetBool(); - m_password = fields[5].GetString(); - const char* db_BannedList = fields[6].GetString(); + m_announce = fields[0].GetBool(); + m_moderate = fields[1].GetBool(); + m_public = fields[2].GetBool(); + m_password = fields[3].GetString(); + const char* db_BannedList = fields[4].GetString(); m_IsSaved = true; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 0ce50659fb1..cffb81253a3 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -8252,7 +8252,7 @@ void ObjectMgr::LoadTrainerSpell() int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors) { // find all items from the reference vendor - QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d'", item); + QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d'", item); if (!result) { barGoLink bar(1); @@ -8269,17 +8269,16 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *s bar.step(); Field* fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); - int32 item_id = fields[1].GetInt32(); + int32 item_id = fields[0].GetInt32(); // if item is a negative, its a reference if (item_id < 0) count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[2].GetInt32(); - uint32 incrtime = fields[3].GetUInt32(); - uint32 ExtendedCost = fields[4].GetUInt32(); + int32 maxcount = fields[1].GetInt32(); + uint32 incrtime = fields[2].GetUInt32(); + uint32 ExtendedCost = fields[3].GetUInt32(); if (!IsVendorItemValid(vendor,item_id,maxcount,incrtime,ExtendedCost,NULL,skip_vendors)) continue; 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); |