Skip to content

Commit

Permalink
Fix some EVENT_PHASE(_START) checks
Browse files Browse the repository at this point in the history
Fixed the first in process_instant_event, where only the bits pertaining EVENT_PHASE_START were being checked, thus falsely filtering other events, similar case in process(Processors::AddChain)
  • Loading branch information
edo9300 committed Aug 8, 2024
1 parent ff952ca commit 9c1b301
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ int32_t field::process_instant_event() {
newchain.flag = 0;
}
}
if(ev.event_code == EVENT_ADJUST || ev.event_code == EVENT_BREAK_EFFECT || ((ev.event_code & 0xf000) == EVENT_PHASE_START))
if(ev.event_code == EVENT_ADJUST || ev.event_code == EVENT_BREAK_EFFECT || ((ev.event_code & 0xfffff000u) == EVENT_PHASE_START))
continue;
//triggers
pr = effects.trigger_f_effect.equal_range(ev.event_code);
Expand Down Expand Up @@ -3725,7 +3725,7 @@ bool field::process(Processors::AddChain& arg) {
core.current_chain.push_back(clit);
core.current_chain.back().applied_chain_counters = check_chain_counter(peffect, clit.triggering_player, clit.chain_count);
// triggered events which are not caused by RaiseEvent create relation with the handler
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (!(peffect->type & 0x2a0) || (peffect->code & EVENT_PHASE) == EVENT_PHASE)) {
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (!(peffect->type & 0x2a0) || (peffect->code & 0xfffff000u) == EVENT_PHASE)) {
phandler->create_relation(clit);
}
peffect->effect_owner = clit.triggering_player;
Expand Down Expand Up @@ -4019,7 +4019,7 @@ bool field::process(Processors::SolveContinuous& arg) {
return TRUE;
}
core.continuous_chain.push_back(clit);
if(peffect->is_flag(EFFECT_FLAG_DELAY) || (!(peffect->code & 0x10030000) && (peffect->code & (EVENT_PHASE | EVENT_PHASE_START))))
if(peffect->is_flag(EFFECT_FLAG_DELAY) || (!(peffect->code & 0xfffff000u) && (peffect->code & (EVENT_PHASE | EVENT_PHASE_START))))
core.conti_solving = true;
arg.reason_effect = core.reason_effect;
arg.reason_player = core.reason_player;
Expand Down Expand Up @@ -4056,7 +4056,7 @@ bool field::process(Processors::SolveContinuous& arg) {
}
core.continuous_chain.pop_back();
core.solving_continuous.pop_front();
if(peffect->is_flag(EFFECT_FLAG_DELAY) || (!(peffect->code & 0x10030000) && (peffect->code & (EVENT_PHASE | EVENT_PHASE_START)))) {
if(peffect->is_flag(EFFECT_FLAG_DELAY) || (!(peffect->code & 0xfffff000u) && (peffect->code & (EVENT_PHASE | EVENT_PHASE_START)))) {
core.conti_solving = false;
adjust_all();
return FALSE;
Expand Down

0 comments on commit 9c1b301

Please sign in to comment.