mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
Style nits
This commit is contained in:
parent
0f662bf70c
commit
e256175ce6
@ -548,55 +548,54 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id){
|
Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id)
|
||||||
|
{
|
||||||
Trader_Struct* loadti = new Trader_Struct;
|
Trader_Struct* loadti = new Trader_Struct;
|
||||||
memset(loadti,0,sizeof(Trader_Struct));
|
memset(loadti,0,sizeof(Trader_Struct));
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id);
|
std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
_log(TRADING__CLIENT, "Failed to load trader information!\n");
|
_log(TRADING__CLIENT, "Failed to load trader information!\n");
|
||||||
return loadti;
|
return loadti;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadti->Code = BazaarTrader_ShowItems;
|
loadti->Code = BazaarTrader_ShowItems;
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
if(atoi(row[5])>=80 || atoi(row[4])<0) {
|
if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) {
|
||||||
_log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n");
|
_log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadti->Items[atoi(row[5])] = atoi(row[1]);
|
loadti->Items[atoi(row[5])] = atoi(row[1]);
|
||||||
loadti->ItemCost[atoi(row[5])] = atoi(row[4]);
|
loadti->ItemCost[atoi(row[5])] = atoi(row[4]);
|
||||||
}
|
}
|
||||||
return loadti;
|
return loadti;
|
||||||
}
|
}
|
||||||
|
|
||||||
TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id){
|
TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id)
|
||||||
|
{
|
||||||
TraderCharges_Struct* loadti = new TraderCharges_Struct;
|
TraderCharges_Struct* loadti = new TraderCharges_Struct;
|
||||||
memset(loadti,0,sizeof(TraderCharges_Struct));
|
memset(loadti,0,sizeof(TraderCharges_Struct));
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id);
|
std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
_log(TRADING__CLIENT, "Failed to load trader information!\n");
|
_log(TRADING__CLIENT, "Failed to load trader information!\n");
|
||||||
return loadti;
|
return loadti;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
if(atoi(row[5])>=80 || atoi(row[5])<0) {
|
if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) {
|
||||||
_log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n");
|
_log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadti->ItemID[atoi(row[5])] = atoi(row[1]);
|
|
||||||
loadti->SerialNumber[atoi(row[5])] = atoi(row[2]);
|
|
||||||
loadti->Charges[atoi(row[5])] = atoi(row[3]);
|
|
||||||
loadti->ItemCost[atoi(row[5])] = atoi(row[4]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
loadti->ItemID[atoi(row[5])] = atoi(row[1]);
|
||||||
|
loadti->SerialNumber[atoi(row[5])] = atoi(row[2]);
|
||||||
|
loadti->Charges[atoi(row[5])] = atoi(row[3]);
|
||||||
|
loadti->ItemCost[atoi(row[5])] = atoi(row[4]);
|
||||||
|
}
|
||||||
return loadti;
|
return loadti;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user