Skip to content

Commit 9e7116e

Browse files
authored
Fixed "Mementotlan Tatsunootoshigo" (#1167)
Add early termination condition to stop checking combinations when duplicate names are detected, reducing unnecessary computations.
1 parent 72a8f6b commit 9e7116e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

official/c81677154.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
5757
end
5858
function s.rescon(lv)
5959
return function(sg,e,tp,mg)
60-
return sg:GetSum(Card.GetLevel)<=lv and sg:GetClassCount(Card.GetCode)==#sg
60+
return sg:GetSum(Card.GetLevel)<=lv and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg
6161
end
6262
end
6363
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
@@ -66,7 +66,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
6666
if tc and Duel.Destroy(tc,REASON_EFFECT)>0 then
6767
local lv=tc:GetOriginalLevel()
6868
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil,lv)
69-
local sg=aux.SelectUnselectGroup(g,e,tp,1,lv,s.rescon(lv),1,tp,HINTMSG_TOGRAVE)
69+
local sg=aux.SelectUnselectGroup(g,e,tp,1,lv,s.rescon(lv),1,tp,HINTMSG_TOGRAVE,s.rescon(lv))
7070
if #sg>0 then
7171
Duel.SendtoGrave(sg,REASON_EFFECT)
7272
end

0 commit comments

Comments
 (0)