Commit ab74de86 authored by Vury Leo's avatar Vury Leo

less clone

parent bfb506f0
...@@ -3646,6 +3646,7 @@ function Fusion.StrictGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf) ...@@ -3646,6 +3646,7 @@ function Fusion.StrictGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
return Fusion.FinalCheck(e,mg,tc,fgoalcheck,chkf) return Fusion.FinalCheck(e,mg,tc,fgoalcheck,chkf)
end end
--- @param mg_base Group
-- Search mode: find *some* subset of size [grp.min…grp.max] that passes -- Search mode: find *some* subset of size [grp.min…grp.max] that passes
function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf) function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
-- pre‐filter by grp.filter -- pre‐filter by grp.filter
...@@ -3673,9 +3674,9 @@ function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf) ...@@ -3673,9 +3674,9 @@ function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
local fcheck_ok={} local fcheck_ok={}
if hasFCheck then if hasFCheck then
for i,c in ipairs(matched) do for i,c in ipairs(matched) do
local tmp=mg_base:Clone() mg_base:AddCard(c)
tmp:Merge(Group.FromCards(c)) fcheck_ok[i]=aux.FCheckAdditional(tc:GetOwner(),mg_base,tc)
fcheck_ok[i]=aux.FCheckAdditional(tc:GetOwner(),tmp,tc) mg_base:RemoveCard(c)
end end
else else
for i=1,#matched do for i=1,#matched do
......
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