Commit f214527d authored by nanahira's avatar nanahira

add no-side-check

parent 2fc6f7fd
......@@ -188,17 +188,21 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
pcount[deck.side[i]->first]++;
Deck ndeck;
LoadDeck(ndeck, dbuf, mainc, sidec);
#ifndef YGOPRO_NO_SIDE_CHECK
if(ndeck.main.size() != deck.main.size() || ndeck.extra.size() != deck.extra.size())
return false;
#endif
for(size_t i = 0; i < ndeck.main.size(); ++i)
ncount[ndeck.main[i]->first]++;
for(size_t i = 0; i < ndeck.extra.size(); ++i)
ncount[ndeck.extra[i]->first]++;
for(size_t i = 0; i < ndeck.side.size(); ++i)
ncount[ndeck.side[i]->first]++;
#ifndef YGOPRO_NO_SIDE_CHECK
for(auto cdit = ncount.begin(); cdit != ncount.end(); ++cdit)
if(cdit->second != pcount[cdit->first])
return false;
#endif
deck = ndeck;
return true;
}
......
......@@ -58,6 +58,7 @@ boolOptions = {
"no-lua-safe",
"message-debug",
"default-duel-rule",
"no-side-check",
}
for _, boolOption in ipairs(boolOptions) 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