1
This commit is contained in:
parent
db3818a902
commit
1869bad1a1
@ -45,9 +45,11 @@ namespace mt
|
||||
int last_hero_id = 0;
|
||||
int last_hero_lv = 0;
|
||||
int last_weapon_id = 0;
|
||||
std::set<int> last_buff_list;
|
||||
Grasp::MutTraverse
|
||||
(
|
||||
[&last_hero_id, &last_hero_lv, &last_weapon_id] (mt::Grasp* meta, bool& stop) mutable
|
||||
[&last_hero_id, &last_hero_lv, &last_weapon_id, &last_buff_list]
|
||||
(mt::Grasp* meta, bool& stop) mutable
|
||||
{
|
||||
long long key = a8::MakeInt64(meta->hero_id(), meta->hero_lv());
|
||||
if (!last_hero_id) {
|
||||
@ -64,18 +66,35 @@ namespace mt
|
||||
auto tuple = std::make_tuple(meta->weapon_id(), std::set<int>());
|
||||
for (int buff_id : meta->_add_buff_list) {
|
||||
std::get<1>(tuple).insert(buff_id);
|
||||
last_buff_list.insert(buff_id);
|
||||
}
|
||||
for (int buff_id : meta->_remove_buff_list) {
|
||||
std::get<1>(tuple).erase(buff_id);
|
||||
last_buff_list.erase(buff_id);
|
||||
}
|
||||
hero_id_lv_gun_hash_[key] = tuple;
|
||||
} else {
|
||||
if (5 * (last_hero_lv / 5 + 1) != meta->hero_lv()) {
|
||||
abort();
|
||||
}
|
||||
if (last_weapon_id != meta->weapon_id()) {
|
||||
abort();
|
||||
}
|
||||
last_hero_id = meta->hero_id();
|
||||
last_hero_lv = meta->hero_lv();
|
||||
last_weapon_id = meta->weapon_id();
|
||||
|
||||
auto tuple = std::make_tuple(meta->weapon_id(), last_buff_list);
|
||||
for (int buff_id : meta->_add_buff_list) {
|
||||
std::get<1>(tuple).insert(buff_id);
|
||||
last_buff_list.insert(buff_id);
|
||||
}
|
||||
for (int buff_id : meta->_remove_buff_list) {
|
||||
std::get<1>(tuple).erase(buff_id);
|
||||
last_buff_list.erase(buff_id);
|
||||
}
|
||||
hero_id_lv_gun_hash_[key] = tuple;
|
||||
|
||||
if (last_hero_lv == 15) {
|
||||
last_hero_id = 0;
|
||||
last_hero_lv = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user