Commit 296ee7ae authored by mercury233's avatar mercury233 Committed by GitHub

use panelmode when selecting cards from hand having more than 10 cards (#2374)

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

* update
parent a3b33312
......@@ -1468,7 +1468,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
int handcount = 0;
int 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;
......@@ -1490,9 +1491,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;
}
}
......@@ -1533,6 +1533,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
int 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) {
......@@ -1553,6 +1555,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) {
......@@ -1573,6 +1579,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