Commit ca31a4e7 authored by nanahira's avatar nanahira

test oversize thing

parent 216aa519
...@@ -98,6 +98,7 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) { ...@@ -98,6 +98,7 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
return (DECKERROR_SIDECOUNT << 28) + deck.side.size(); return (DECKERROR_SIDECOUNT << 28) + deck.side.size();
const int rule_map[6] = { AVAIL_OCG, AVAIL_TCG, AVAIL_SC, AVAIL_CUSTOM, AVAIL_OCGTCG, 0 }; const int rule_map[6] = { AVAIL_OCG, AVAIL_TCG, AVAIL_SC, AVAIL_CUSTOM, AVAIL_OCGTCG, 0 };
int avail = rule_map[rule]; int avail = rule_map[rule];
int spareCount = 5;
for(size_t i = 0; i < deck.main.size(); ++i) { for(size_t i = 0; i < deck.main.size(); ++i) {
code_pointer cit = deck.main[i]; code_pointer cit = deck.main[i];
int gameruleDeckError = checkAvail(cit->second.ot, avail); int gameruleDeckError = checkAvail(cit->second.ot, avail);
...@@ -111,8 +112,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) { ...@@ -111,8 +112,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if(dc > 3) if(dc > 3)
return (DECKERROR_CARDCOUNT << 28) + cit->first; return (DECKERROR_CARDCOUNT << 28) + cit->first;
auto it = list->find(code); auto it = list->find(code);
if(it != list->end() && dc > it->second) if(it != list->end() && dc > it->second) {
return (DECKERROR_LFLIST << 28) + cit->first; if (!spareCount)
return (DECKERROR_LFLIST << 28) + cit->first;
else
--spareCount;
}
} }
for(size_t i = 0; i < deck.extra.size(); ++i) { for(size_t i = 0; i < deck.extra.size(); ++i) {
code_pointer cit = deck.extra[i]; code_pointer cit = deck.extra[i];
...@@ -125,8 +130,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) { ...@@ -125,8 +130,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if(dc > 3) if(dc > 3)
return (DECKERROR_CARDCOUNT << 28) + cit->first; return (DECKERROR_CARDCOUNT << 28) + cit->first;
auto it = list->find(code); auto it = list->find(code);
if(it != list->end() && dc > it->second) if(it != list->end() && dc > it->second) {
return (DECKERROR_LFLIST << 28) + cit->first; if (!spareCount)
return (DECKERROR_LFLIST << 28) + cit->first;
else
--spareCount;
}
} }
for(size_t i = 0; i < deck.side.size(); ++i) { for(size_t i = 0; i < deck.side.size(); ++i) {
code_pointer cit = deck.side[i]; code_pointer cit = deck.side[i];
...@@ -139,8 +148,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) { ...@@ -139,8 +148,12 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if(dc > 3) if(dc > 3)
return (DECKERROR_CARDCOUNT << 28) + cit->first; return (DECKERROR_CARDCOUNT << 28) + cit->first;
auto it = list->find(code); auto it = list->find(code);
if(it != list->end() && dc > it->second) if(it != list->end() && dc > it->second) {
return (DECKERROR_LFLIST << 28) + cit->first; if (!spareCount)
return (DECKERROR_LFLIST << 28) + cit->first;
else
--spareCount;
}
} }
return 0; return 0;
} }
......
Subproject commit 712bb529afb1e50a800aff8f5b65530302f209f1 Subproject commit edf78c89e896b62df9d0e7ff0117598bdf8fdae0
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