mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
LoadTickItems converted to QueryDatabase
This commit is contained in:
parent
029314ec7f
commit
19e04a1875
@ -2296,35 +2296,30 @@ void Zone::ReloadWorld(uint32 Option){
|
|||||||
|
|
||||||
void Zone::LoadTickItems()
|
void Zone::LoadTickItems()
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char* query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
tick_items.clear();
|
tick_items.clear();
|
||||||
|
|
||||||
if(database.RunQuery(query, MakeAnyLenString(&query, "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"), errbuf, &result))
|
const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick";
|
||||||
{
|
auto results = database.QueryDatabase(query);
|
||||||
while((row = mysql_fetch_row(result)))
|
if (!results.Success()) {
|
||||||
{
|
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
if(atoi(row[0]) >= 1)
|
return;
|
||||||
{
|
}
|
||||||
item_tick_struct ti_tmp;
|
|
||||||
ti_tmp.itemid = atoi(row[0]);
|
|
||||||
ti_tmp.chance = atoi(row[1]);
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
ti_tmp.level = atoi(row[2]);
|
if(atoi(row[0]) == 0)
|
||||||
ti_tmp.bagslot = (int16)atoi(row[4]);
|
continue;
|
||||||
ti_tmp.qglobal = std::string(row[3]);
|
|
||||||
tick_items[atoi(row[0])] = ti_tmp;
|
item_tick_struct ti_tmp;
|
||||||
}
|
ti_tmp.itemid = atoi(row[0]);
|
||||||
}
|
ti_tmp.chance = atoi(row[1]);
|
||||||
mysql_free_result(result);
|
ti_tmp.level = atoi(row[2]);
|
||||||
safe_delete_array(query);
|
ti_tmp.bagslot = (int16)atoi(row[4]);
|
||||||
}
|
ti_tmp.qglobal = std::string(row[3]);
|
||||||
else
|
tick_items[atoi(row[0])] = ti_tmp;
|
||||||
{
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadTickItems: %s (%s)", query, errbuf);
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user