mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Make ZoneDatabase::FillAAEffects get the data from memory
Note: This should probably be moved out of ZoneDatabase
This commit is contained in:
parent
272180ff0f
commit
b3d8e22539
20
zone/aa.cpp
20
zone/aa.cpp
@ -1751,19 +1751,15 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){
|
|||||||
if(!aa_struct)
|
if(!aa_struct)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT effectid, base1, base2, slot from aa_effects where aaid=%i order by slot asc", aa_struct->id);
|
auto it = aa_effects.find(aa_struct->id);
|
||||||
auto results = QueryDatabase(query);
|
if (it != aa_effects.end()) {
|
||||||
if (!results.Success()) {
|
for (int slot = 0; slot < aa_struct->total_abilities; slot++) {
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Client::FillAAEffects query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
// aa_effects is a map of a map, so the slot reference does not start at 0
|
||||||
return;
|
aa_struct->abilities[slot].skill_id = it->second[slot + 1].skill_id;
|
||||||
|
aa_struct->abilities[slot].base1 = it->second[slot + 1].base1;
|
||||||
|
aa_struct->abilities[slot].base2 = it->second[slot + 1].base2;
|
||||||
|
aa_struct->abilities[slot].slot = it->second[slot + 1].slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
|
||||||
aa_struct->abilities[index].skill_id=atoi(row[0]);
|
|
||||||
aa_struct->abilities[index].base1=atoi(row[1]);
|
|
||||||
aa_struct->abilities[index].base2=atoi(row[2]);
|
|
||||||
aa_struct->abilities[index].slot=atoi(row[3]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user