mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Moved effects to a vector since we dont need the random access by slot
This commit is contained in:
parent
963eb91669
commit
8422ce6f25
14
zone/aa.cpp
14
zone/aa.cpp
@ -2120,10 +2120,10 @@ void Client::SendAlternateAdvancementRank(int aa_id, int level) {
|
|||||||
|
|
||||||
outapp->SetWritePosition(sizeof(AARankInfo_Struct));
|
outapp->SetWritePosition(sizeof(AARankInfo_Struct));
|
||||||
for(auto effect : rank->effects) {
|
for(auto effect : rank->effects) {
|
||||||
outapp->WriteSInt32(effect.second.effect_id);
|
outapp->WriteSInt32(effect.effect_id);
|
||||||
outapp->WriteSInt32(effect.second.base1);
|
outapp->WriteSInt32(effect.base1);
|
||||||
outapp->WriteSInt32(effect.second.base2);
|
outapp->WriteSInt32(effect.base2);
|
||||||
outapp->WriteSInt32(effect.first);
|
outapp->WriteSInt32(effect.slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto prereq : rank->prereqs) {
|
for(auto prereq : rank->prereqs) {
|
||||||
@ -2361,17 +2361,17 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
|||||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||||
AA::RankEffect effect;
|
AA::RankEffect effect;
|
||||||
int rank_id = atoi(row[0]);
|
int rank_id = atoi(row[0]);
|
||||||
int slot = atoi(row[1]);
|
effect.slot = atoi(row[1]);
|
||||||
effect.effect_id = atoi(row[2]);
|
effect.effect_id = atoi(row[2]);
|
||||||
effect.base1 = atoi(row[3]);
|
effect.base1 = atoi(row[3]);
|
||||||
effect.base2 = atoi(row[4]);
|
effect.base2 = atoi(row[4]);
|
||||||
|
|
||||||
if(slot < 1 || slot > 12)
|
if(effect.slot < 1 || effect.slot > 12)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(ranks.count(rank_id) > 0) {
|
if(ranks.count(rank_id) > 0) {
|
||||||
AA::Rank *rank = ranks[rank_id].get();
|
AA::Rank *rank = ranks[rank_id].get();
|
||||||
rank->effects[slot] = effect;
|
rank->effects.push_back(effect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public:
|
|||||||
uint32 account_time_required;
|
uint32 account_time_required;
|
||||||
int total_cost;
|
int total_cost;
|
||||||
Ability *base_ability;
|
Ability *base_ability;
|
||||||
std::unordered_map<int, RankEffect> effects;
|
std::vector<RankEffect> effects;
|
||||||
std::vector<RankPrereq> prereqs;
|
std::vector<RankPrereq> prereqs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ namespace AA
|
|||||||
|
|
||||||
struct RankEffect
|
struct RankEffect
|
||||||
{
|
{
|
||||||
|
int slot;
|
||||||
int effect_id;
|
int effect_id;
|
||||||
int base1;
|
int base1;
|
||||||
int base2;
|
int base2;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user