Skip to content

Commit

Permalink
Fix EFFECT_FORCE_NORMAL_SUMMON_POSITION
Browse files Browse the repository at this point in the history
It got erroneously added in the variant rework, and was in an incomplete state, fixup what is possible for the moment
  • Loading branch information
edo9300 committed May 30, 2024
1 parent 04f75a8 commit 7a81311
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,26 @@ int32_t field::is_player_can_summon(uint32_t sumtype, uint8_t playerid, card* pc
if(pduel->lua->check_condition(peff->target, 6))
return FALSE;
}
eset.clear();
filter_player_effect(playerid, EFFECT_FORCE_NORMAL_SUMMON_POSITION, &eset);
uint8_t sumpos = POS_FACEUP_ATTACK;
if(is_player_affected_by_effect(playerid, EFFECT_DEVINE_LIGHT))
sumpos = POS_FACEUP;
for(auto& eff : eset) {
if(eff->target) {
pduel->lua->add_param<LuaParam::EFFECT>(eff);
pduel->lua->add_param<LuaParam::CARD>(pcard);
pduel->lua->add_param<LuaParam::INT>(playerid);
pduel->lua->add_param<LuaParam::INT>(sumtype);
pduel->lua->add_param<LuaParam::INT>(sumpos);
pduel->lua->add_param<LuaParam::INT>(toplayer);
if(!pduel->lua->check_condition(eff->target, 6))
continue;
}
sumpos &= eff->get_value();
if(sumpos == 0)
return FALSE;
}
return TRUE;
}
int32_t field::is_player_can_mset(uint32_t sumtype, uint8_t playerid, card* pcard, uint8_t toplayer) {
Expand Down
2 changes: 1 addition & 1 deletion operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@ bool field::process(Processors::SummonRule& arg) {
pduel->lua->add_param<LuaParam::INT>(target->summon.type);
pduel->lua->add_param<LuaParam::INT>(positions);
pduel->lua->add_param<LuaParam::INT>(targetplayer);
if(!pduel->lua->check_condition(eff->target, 5))
if(!pduel->lua->check_condition(eff->target, 6))
continue;
}
positions &= eff->get_value();
Expand Down

0 comments on commit 7a81311

Please sign in to comment.