Commit 13a49b4d authored by nanahira's avatar nanahira

allow limit 3

parent 99cb5ed9
......@@ -103,10 +103,9 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
if (!lflist)
return 0;
auto& list = lflist->content;
char remaining_limit[3]{};
remaining_limit[0] = 0;
remaining_limit[1] = 1;
remaining_limit[2] = 2;
char remaining_limit[4]{};
for (int i = 0; i < 4; ++i)
remaining_limit[i] = i;
const unsigned int rule_map[6] = { AVAIL_OCG, AVAIL_TCG, AVAIL_SC, AVAIL_CUSTOM, AVAIL_OCGTCG, 0 };
unsigned int avail = 0;
if (rule >= 0 && rule < (int)(sizeof rule_map / sizeof rule_map[0]))
......@@ -125,8 +124,8 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
auto it = list.find(code);
if(it != list.end()) {
auto limit = it->second;
if(limit > 2)
limit = 2;
if(limit > 3)
limit = 3;
if(remaining_limit[limit] == 0)
return (DECKERROR_LFLIST << 28) | cit->first;
--remaining_limit[limit];
......@@ -146,8 +145,8 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
auto it = list.find(code);
if(it != list.end()) {
auto limit = it->second;
if(limit > 2)
limit = 2;
if(limit > 3)
limit = 3;
if(remaining_limit[limit] == 0)
return (DECKERROR_LFLIST << 28) | cit->first;
--remaining_limit[limit];
......@@ -167,8 +166,8 @@ unsigned int DeckManager::CheckDeck(const Deck& deck, unsigned int lfhash, int r
auto it = list.find(code);
if(it != list.end()) {
auto limit = it->second;
if(limit > 2)
limit = 2;
if(limit > 3)
limit = 3;
if(remaining_limit[limit] == 0)
return (DECKERROR_LFLIST << 28) | cit->first;
--remaining_limit[limit];
......
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