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