Commit 7124d8a0 authored by salix5's avatar salix5

field::solve_continuous()

EFFECT_FLAG_DELAY: delayed to next solved chain/continuous effect
parent 76e3690e
......@@ -2209,7 +2209,7 @@ int32 field::process_instant_event() {
peffect = pr.first->second;
uint8 owner_player = peffect->get_handler_player();
if(peffect->is_activateable(owner_player, *elit)) {
if((peffect->is_flag(EFFECT_FLAG_DELAY)) && (core.chain_solving || core.conti_solving)) {
if(peffect->is_flag(EFFECT_FLAG_DELAY) && (core.chain_solving || core.conti_solving)) {
if(owner_player == infos.turn_player) {
core.delayed_tp.push_back(peffect);
core.delayed_tev.push_back(*elit);
......@@ -2344,7 +2344,7 @@ int32 field::process_single_event() {
if(peffect->type & EFFECT_TYPE_CONTINUOUS) {
uint8 owner_player = peffect->get_handler_player();
if(peffect->is_activateable(owner_player, e)) {
if((peffect->is_flag(EFFECT_FLAG_DELAY)) && (core.chain_solving || core.conti_solving)) {
if(peffect->is_flag(EFFECT_FLAG_DELAY) && (core.chain_solving || core.conti_solving)) {
if(owner_player == infos.turn_player) {
core.delayed_tp.push_back(peffect);
core.delayed_tev.push_back(e);
......@@ -4441,7 +4441,6 @@ int32 field::solve_continuous(uint16 step, effect * peffect, uint8 triggering_pl
newchain.disable_reason = 0;
newchain.flag = 0;
core.continuous_chain.push_back(newchain);
if(peffect->is_flag(EFFECT_FLAG_DELAY))
core.conti_solving = TRUE;
if(!peffect->target)
return FALSE;
......@@ -4469,9 +4468,10 @@ int32 field::solve_continuous(uint16 step, effect * peffect, uint8 triggering_pl
}
core.continuous_chain.pop_back();
core.solving_event.pop_front();
if(peffect->is_flag(EFFECT_FLAG_DELAY)) {
core.conti_solving = FALSE;
adjust_all();
if(core.conti_player == PLAYER_NONE)
core.conti_player = infos.turn_player;
if(core.conti_player == infos.turn_player) {
if(core.delayed_tp.size()) {
core.sub_solving_event.push_back(core.delayed_tev.front());
......@@ -4499,7 +4499,6 @@ int32 field::solve_continuous(uint16 step, effect * peffect, uint8 triggering_pl
else
core.conti_player = PLAYER_NONE;
}
}
return TRUE;
}
}
......
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