Commit 0ab4dbe8 authored by DailyShana's avatar DailyShana

fix MSG_SELECT_SUM

parent 259d3ca0
......@@ -1100,12 +1100,13 @@ void ClientField::FadeCard(ClientCard * pcard, int alpha, int frame) {
pcard->is_fading = true;
pcard->aniFrame = frame;
}
void ClientField::ShowSelectSum(bool panelmode) {
bool ClientField::ShowSelectSum(bool panelmode) {
if(panelmode) {
if(CheckSelectSum()) {
if(selectsum_cards.size() == 0 || selectable_cards.size() == 0) {
SetResponseSelectedCards();
mainGame->HideElement(mainGame->wCardSelect, true);
return true;
} else {
select_ready = true;
mainGame->wCardSelect->setVisible(false);
......@@ -1121,6 +1122,7 @@ void ClientField::ShowSelectSum(bool panelmode) {
if(selectsum_cards.size() == 0 || selectable_cards.size() == 0) {
SetResponseSelectedCards();
DuelClient::SendResponse();
return true;
} else {
select_ready = true;
wchar_t wbuf[256], *pwbuf = wbuf;
......@@ -1133,6 +1135,7 @@ void ClientField::ShowSelectSum(bool panelmode) {
} else
select_ready = false;
}
return false;
}
bool ClientField::CheckSelectSum() {
std::set<ClientCard*> selable;
......
......@@ -96,7 +96,7 @@ public:
void GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, irr::core::vector3df* r, bool setTrans = false);
void MoveCard(ClientCard* pcard, int frame);
void FadeCard(ClientCard* pcard, int alpha, int frame);
void ShowSelectSum(bool panelmode);
bool ShowSelectSum(bool panelmode);
bool CheckSelectSum();
bool check_min(std::set<ClientCard*>& left, std::set<ClientCard*>::iterator index, int min, int max);
bool check_sel_sum_s(const std::set<ClientCard*>& left, int index, int acc);
......
......@@ -1470,8 +1470,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
}
mainGame->dField.ShowSelectSum(panelmode);
return false;
return mainGame->dField.ShowSelectSum(panelmode);
}
case MSG_SORT_CARD:
case MSG_SORT_CHAIN: {
......
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