Commit c397018c authored by mercury233's avatar mercury233 Committed by GitHub

fix delayed quick effect (#413)

parent 57ede936
......@@ -303,6 +303,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return FALSE;
if((phandler->get_type() & TYPE_CONTINUOUS) && (phandler->get_type() & TYPE_EQUIP))
return FALSE;
if((type & EFFECT_TYPE_QUICK_O) && is_flag(EFFECT_FLAG_DELAY) && !in_range(phandler))
return FALSE;
if(!neglect_faceup && (phandler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED))) {
if(!phandler->is_position(POS_FACEUP) && !is_flag(EFFECT_FLAG_SET_AVAILABLE))
return FALSE;
......
......@@ -1683,6 +1683,13 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
core.select_chains.push_back(newchain);
}
}
pr = effects.quick_o_effect.equal_range(ev.event_code);
for(auto eit = pr.first; eit != pr.second;) {
effect* peffect = eit->second;
++eit;
if(peffect->is_flag(EFFECT_FLAG_DELAY) && peffect->is_condition_check(peffect->get_handler()->current.controler, ev))
core.delayed_quick.emplace(peffect, ev);
}
}
// delayed quick
for(auto eit = core.delayed_quick.begin(); eit != core.delayed_quick.end();) {
......
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