From 7a8131159807d7324c60cae85f9686b35311425f Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Thu, 30 May 2024 17:29:07 +0200 Subject: [PATCH] Fix EFFECT_FORCE_NORMAL_SUMMON_POSITION It got erroneously added in the variant rework, and was in an incomplete state, fixup what is possible for the moment --- field.cpp | 20 ++++++++++++++++++++ operations.cpp | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/field.cpp b/field.cpp index c564b12d..9289544a 100644 --- a/field.cpp +++ b/field.cpp @@ -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(eff); + pduel->lua->add_param(pcard); + pduel->lua->add_param(playerid); + pduel->lua->add_param(sumtype); + pduel->lua->add_param(sumpos); + pduel->lua->add_param(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) { diff --git a/operations.cpp b/operations.cpp index 95ec32f3..b396fbb3 100644 --- a/operations.cpp +++ b/operations.cpp @@ -2181,7 +2181,7 @@ bool field::process(Processors::SummonRule& arg) { pduel->lua->add_param(target->summon.type); pduel->lua->add_param(positions); pduel->lua->add_param(targetplayer); - if(!pduel->lua->check_condition(eff->target, 5)) + if(!pduel->lua->check_condition(eff->target, 6)) continue; } positions &= eff->get_value();