mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-29 04:12:24 +00:00
FillAAEffects converted to QueryDatabase
This commit is contained in:
parent
110d22e775
commit
64cd589ca3
30
zone/AA.cpp
30
zone/AA.cpp
@ -1714,24 +1714,20 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){
|
|||||||
if(!aa_struct)
|
if(!aa_struct)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT effectid, base1, base2, slot from aa_effects where aaid=%i order by slot asc", aa_struct->id);
|
||||||
char *query = 0;
|
auto results = QueryDatabase(query);
|
||||||
MYSQL_RES *result;
|
if (!results.Success()) {
|
||||||
MYSQL_ROW row;
|
LogFile->write(EQEMuLog::Error, "Error in Client::FillAAEffects query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT effectid, base1, base2, slot from aa_effects where aaid=%i order by slot asc", aa_struct->id), errbuf, &result)) {
|
return;
|
||||||
int ndx=0;
|
}
|
||||||
while((row = mysql_fetch_row(result))!=nullptr) {
|
|
||||||
aa_struct->abilities[ndx].skill_id=atoi(row[0]);
|
int index = 0;
|
||||||
aa_struct->abilities[ndx].base1=atoi(row[1]);
|
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
||||||
aa_struct->abilities[ndx].base2=atoi(row[2]);
|
aa_struct->abilities[index].skill_id=atoi(row[0]);
|
||||||
aa_struct->abilities[ndx].slot=atoi(row[3]);
|
aa_struct->abilities[index].base1=atoi(row[1]);
|
||||||
ndx++;
|
aa_struct->abilities[index].base2=atoi(row[2]);
|
||||||
}
|
aa_struct->abilities[index].slot=atoi(row[3]);
|
||||||
mysql_free_result(result);
|
|
||||||
} else {
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Client::FillAAEffects query: '%s': %s", query, errbuf);
|
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ZoneDatabase::CountAAs(){
|
uint32 ZoneDatabase::CountAAs(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user