Commit 2347a6ea authored by salix5's avatar salix5

revert

revert the changes to effects.disable_check_list
parent 7646ecfa
...@@ -2427,7 +2427,7 @@ void card::filter_immune_effect() { ...@@ -2427,7 +2427,7 @@ void card::filter_immune_effect() {
immune_effect.sort(); immune_effect.sort();
} }
// for all disable-related peffect of this, // for all disable-related peffect of this,
// 1. Insert all cards in the target of peffect into effects.disable_check_set. // 1. Insert all cards in the target of peffect into effects.disable_check_list.
// 2. Insert equiping_target of peffect into it. // 2. Insert equiping_target of peffect into it.
// 3. Insert overlay_target of peffect into it. // 3. Insert overlay_target of peffect into it.
// 4. Insert continuous target of this into it. // 4. Insert continuous target of this into it.
......
...@@ -1869,7 +1869,7 @@ int32 field::get_overlay_count(uint8 self, uint8 s, uint8 o) { ...@@ -1869,7 +1869,7 @@ int32 field::get_overlay_count(uint8 self, uint8 s, uint8 o) {
} }
return count; return count;
} }
// put all cards in the target of peffect into effects.disable_check_set // put all cards in the target of peffect into effects.disable_check_list
void field::update_disable_check_list(effect* peffect) { void field::update_disable_check_list(effect* peffect) {
card_set cset; card_set cset;
filter_affected_cards(peffect, &cset); filter_affected_cards(peffect, &cset);
...@@ -1877,18 +1877,22 @@ void field::update_disable_check_list(effect* peffect) { ...@@ -1877,18 +1877,22 @@ void field::update_disable_check_list(effect* peffect) {
add_to_disable_check_list(pcard); add_to_disable_check_list(pcard);
} }
void field::add_to_disable_check_list(card* pcard) { void field::add_to_disable_check_list(card* pcard) {
effects.disable_check_set.insert(pcard); auto result=effects.disable_check_set.insert(pcard);
if(!result.second)
return
effects.disable_check_list.push_back(pcard);
} }
void field::adjust_disable_check_list() { void field::adjust_disable_check_list() {
card* checking; card* checking;
int32 pre_disable, new_disable; int32 pre_disable, new_disable;
if (!effects.disable_check_set.size()) if (!effects.disable_check_list.size())
return; return;
card_set checked; card_set checked;
do { do {
checked.clear(); checked.clear();
while (effects.disable_check_set.size()) { while (effects.disable_check_list.size()) {
checking = *(effects.disable_check_set.begin()); checking = effects.disable_check_list.front();
effects.disable_check_list.pop_front();
effects.disable_check_set.erase(checking); effects.disable_check_set.erase(checking);
checked.insert(checking); checked.insert(checking);
if (checking->is_status(STATUS_TO_ENABLE | STATUS_TO_DISABLE)) if (checking->is_status(STATUS_TO_ENABLE | STATUS_TO_DISABLE))
...@@ -1909,7 +1913,7 @@ void field::adjust_disable_check_list() { ...@@ -1909,7 +1913,7 @@ void field::adjust_disable_check_list() {
pcard->reset(RESET_DISABLE, RESET_EVENT); pcard->reset(RESET_DISABLE, RESET_EVENT);
pcard->set_status(STATUS_TO_ENABLE | STATUS_TO_DISABLE, FALSE); pcard->set_status(STATUS_TO_ENABLE | STATUS_TO_DISABLE, FALSE);
} }
} while(effects.disable_check_set.size()); } while(effects.disable_check_list.size());
} }
// adjust SetUniqueOnField(), EFFECT_SELF_DESTROY, EFFECT_SELF_TOGRAVE // adjust SetUniqueOnField(), EFFECT_SELF_DESTROY, EFFECT_SELF_TOGRAVE
void field::adjust_self_destroy_set() { void field::adjust_self_destroy_set() {
......
...@@ -110,6 +110,7 @@ struct field_effect { ...@@ -110,6 +110,7 @@ struct field_effect {
effect_collection rechargeable; effect_collection rechargeable;
effect_collection spsummon_count_eff; effect_collection spsummon_count_eff;
std::list<card*> disable_check_list;
std::unordered_set<card*> disable_check_set; std::unordered_set<card*> disable_check_set;
grant_effect_container grant_effect; grant_effect_container grant_effect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment