Commit 57fbf901 authored by fallenstardust's avatar fallenstardust

use panelmode when selecting cards from hand having more than 10 cards

parent 62948c3e
......@@ -1476,7 +1476,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
int handcount = 0;
size_t hand_count[2] = { mainGame->dField.hand[0].size(), mainGame->dField.hand[1].size() };
int select_count_in_hand[2] = { 0, 0 };
bool select_ready = mainGame->dField.select_min == 0;
mainGame->dField.select_ready = select_ready;
ClientCard* pcard;
......@@ -1498,9 +1499,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = false;
if (l & 0xf1)
panelmode = true;
if(l & LOCATION_HAND) {
handcount++;
if(handcount >= 10)
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
......@@ -1541,6 +1541,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
size_t hand_count[2] = { mainGame->dField.hand[0].size(), mainGame->dField.hand[1].size() };
int select_count_in_hand[2] = { 0, 0 };
mainGame->dField.select_ready = false;
ClientCard* pcard;
for (int i = 0; i < count1; ++i) {
......@@ -1561,6 +1563,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = false;
if (l & 0xf1)
panelmode = true;
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
int count2 = BufferIO::ReadInt8(pbuf);
for (int i = count1; i < count1 + count2; ++i) {
......@@ -1581,6 +1587,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = true;
if (l & 0xf1)
panelmode = true;
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
std::sort(mainGame->dField.selectable_cards.begin(), mainGame->dField.selectable_cards.end(), ClientCard::client_card_sort);
if(select_hint)
......
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