Commit 217ab696 authored by nanahira's avatar nanahira

simplify

parent 7e38079c
Pipeline #42020 failed with stages
in 23 minutes and 31 seconds
......@@ -1954,17 +1954,15 @@ bool DeckBuilder::check_limit(code_pointer pointer) {
}
return valid;
};
auto limitcode_has_credit = filterList->credits.find(limitcode) != filterList->credits.end();
auto handle_card = [&](ygo::code_pointer& card) {
if (card->first == limitcode || card->second.alias == limitcode) {
limit--;
if(limit < 0)
return false;
}
// No entry in credits => skip every card credit check
if(filterList->credits.find(limitcode) == filterList->credits.end())
if(!limitcode_has_credit)
return true;
auto code = card->second.alias ? card->second.alias : card->first;
return spend_credit(code);
};
......
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