Remove unused columns from sqls
--HG-- branch : trunk
This commit is contained in:
@@ -54,17 +54,15 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
|||||||
//load not built in channel if saved
|
//load not built in channel if saved
|
||||||
std::string _name(name);
|
std::string _name(name);
|
||||||
CharacterDatabase.escape_string(_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
|
if (result)//load
|
||||||
{
|
{
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
const char* db_name = fields[0].GetString();
|
m_announce = fields[0].GetBool();
|
||||||
uint32 db_team = fields[1].GetUInt32();
|
m_moderate = fields[1].GetBool();
|
||||||
m_announce = fields[2].GetBool();
|
m_public = fields[2].GetBool();
|
||||||
m_moderate = fields[3].GetBool();
|
m_password = fields[3].GetString();
|
||||||
m_public = fields[4].GetBool();
|
const char* db_BannedList = fields[4].GetString();
|
||||||
m_password = fields[5].GetString();
|
|
||||||
const char* db_BannedList = fields[6].GetString();
|
|
||||||
|
|
||||||
m_IsSaved = true;
|
m_IsSaved = true;
|
||||||
|
|
||||||
|
|||||||
@@ -8252,7 +8252,7 @@ void ObjectMgr::LoadTrainerSpell()
|
|||||||
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
|
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
|
||||||
{
|
{
|
||||||
// find all items from the reference vendor
|
// 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)
|
if (!result)
|
||||||
{
|
{
|
||||||
barGoLink bar(1);
|
barGoLink bar(1);
|
||||||
@@ -8269,17 +8269,16 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *s
|
|||||||
bar.step();
|
bar.step();
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
|
|
||||||
uint32 entry = fields[0].GetUInt32();
|
int32 item_id = fields[0].GetInt32();
|
||||||
int32 item_id = fields[1].GetInt32();
|
|
||||||
|
|
||||||
// if item is a negative, its a reference
|
// if item is a negative, its a reference
|
||||||
if (item_id < 0)
|
if (item_id < 0)
|
||||||
count += LoadReferenceVendor(vendor, -item_id, skip_vendors);
|
count += LoadReferenceVendor(vendor, -item_id, skip_vendors);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int32 maxcount = fields[2].GetInt32();
|
int32 maxcount = fields[1].GetInt32();
|
||||||
uint32 incrtime = fields[3].GetUInt32();
|
uint32 incrtime = fields[2].GetUInt32();
|
||||||
uint32 ExtendedCost = fields[4].GetUInt32();
|
uint32 ExtendedCost = fields[3].GetUInt32();
|
||||||
|
|
||||||
if (!IsVendorItemValid(vendor,item_id,maxcount,incrtime,ExtendedCost,NULL,skip_vendors))
|
if (!IsVendorItemValid(vendor,item_id,maxcount,incrtime,ExtendedCost,NULL,skip_vendors))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ void WaypointStore::UpdatePath(uint32 id)
|
|||||||
|
|
||||||
QueryResult_AutoPtr result;
|
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)
|
if (!result)
|
||||||
return;
|
return;
|
||||||
@@ -118,26 +118,25 @@ void WaypointStore::UpdatePath(uint32 id)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
fields = result->Fetch();
|
fields = result->Fetch();
|
||||||
uint32 id = fields[0].GetUInt32();
|
|
||||||
|
|
||||||
WaypointData *wp = new WaypointData;
|
WaypointData *wp = new WaypointData;
|
||||||
|
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
x = fields[2].GetFloat();
|
x = fields[1].GetFloat();
|
||||||
y = fields[3].GetFloat();
|
y = fields[2].GetFloat();
|
||||||
z = fields[4].GetFloat();
|
z = fields[3].GetFloat();
|
||||||
|
|
||||||
Trinity::NormalizeMapCoord(x);
|
Trinity::NormalizeMapCoord(x);
|
||||||
Trinity::NormalizeMapCoord(y);
|
Trinity::NormalizeMapCoord(y);
|
||||||
|
|
||||||
wp->id = fields[1].GetUInt32();
|
wp->id = fields[0].GetUInt32();
|
||||||
wp->x = x;
|
wp->x = x;
|
||||||
wp->y = y;
|
wp->y = y;
|
||||||
wp->z = z;
|
wp->z = z;
|
||||||
wp->run = fields[5].GetBool();
|
wp->run = fields[4].GetBool();
|
||||||
wp->delay = fields[6].GetUInt32();
|
wp->delay = fields[5].GetUInt32();
|
||||||
wp->event_id = fields[7].GetUInt32();
|
wp->event_id = fields[6].GetUInt32();
|
||||||
wp->event_chance = fields[8].GetUInt8();
|
wp->event_chance = fields[7].GetUInt8();
|
||||||
|
|
||||||
path_data->push_back(wp);
|
path_data->push_back(wp);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user