Commit 87a3541a authored by Chen Bill's avatar Chen Bill Committed by GitHub

revert: X can gain an effect from itself (#665)

* revert: X can gain an effect from itself

* reject EFFECT_UNIQUE_CHECK in adjust_grant_effect
parent e090c4f9
...@@ -1959,6 +1959,7 @@ effect_indexer::iterator card::remove_effect(effect* peffect) { ...@@ -1959,6 +1959,7 @@ effect_indexer::iterator card::remove_effect(effect* peffect) {
pduel->game_field->update_disable_check_list(peffect); pduel->game_field->update_disable_check_list(peffect);
} }
field_effect.erase(it); field_effect.erase(it);
pduel->game_field->remove_effect(peffect);
} }
if ((current.controler != PLAYER_NONE) && !get_status(STATUS_DISABLED | STATUS_FORBIDDEN) && !check_target.empty()) { if ((current.controler != PLAYER_NONE) && !get_status(STATUS_DISABLED | STATUS_FORBIDDEN) && !check_target.empty()) {
if (peffect->is_disable_related()) { if (peffect->is_disable_related()) {
...@@ -2002,7 +2003,6 @@ effect_indexer::iterator card::remove_effect(effect* peffect) { ...@@ -2002,7 +2003,6 @@ effect_indexer::iterator card::remove_effect(effect* peffect) {
unique_pos[0] = unique_pos[1] = 0; unique_pos[0] = unique_pos[1] = 0;
unique_code = 0; unique_code = 0;
} }
pduel->game_field->remove_effect(peffect);
pduel->game_field->core.reseted_effects.insert(peffect); pduel->game_field->core.reseted_effects.insert(peffect);
return ret; return ret;
} }
......
...@@ -2124,6 +2124,8 @@ int32 field::adjust_grant_effect() { ...@@ -2124,6 +2124,8 @@ int32 field::adjust_grant_effect() {
effect* geffect = (effect*)peffect->get_label_object(); effect* geffect = (effect*)peffect->get_label_object();
if (geffect->type & EFFECT_TYPE_GRANT) if (geffect->type & EFFECT_TYPE_GRANT)
continue; continue;
if (geffect->code == EFFECT_UNIQUE_CHECK)
continue;
card_set cset; card_set cset;
if(peffect->is_available()) if(peffect->is_available())
filter_affected_cards(peffect, &cset); filter_affected_cards(peffect, &cset);
...@@ -2138,9 +2140,6 @@ int32 field::adjust_grant_effect() { ...@@ -2138,9 +2140,6 @@ int32 field::adjust_grant_effect() {
if(!pcard->is_affect_by_effect(peffect) || !cset.count(pcard)) if(!pcard->is_affect_by_effect(peffect) || !cset.count(pcard))
remove_set.insert(pcard); remove_set.insert(pcard);
} }
//X gains an effect from itself will break card::remove_effect
if (!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY))
add_set.erase(peffect->handler);
for(auto& pcard : add_set) { for(auto& pcard : add_set) {
effect* ceffect = geffect->clone(); effect* ceffect = geffect->clone();
ceffect->owner = pcard; ceffect->owner = pcard;
......
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