Commit 64f6ff07 authored by DailyShana's avatar DailyShana

update COMMAND_OPERATION

parent 03975dd2
......@@ -39,6 +39,7 @@ public:
std::vector<ClientCard*> conti_cards;
std::vector<int> activatable_descs;
std::set<int> reset_descs;
std::set<int> conti_descs;
std::vector<int> select_options;
std::vector<ChainInfo> chains;
int extra_p_count[2];
......
......@@ -1205,6 +1205,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.activatable_descs.clear();
mainGame->dField.conti_cards.clear();
mainGame->dField.reset_descs.clear();
mainGame->dField.conti_descs.clear();
for (int i = 0; i < count; ++i) {
int flag = BufferIO::ReadInt8(pbuf);
code = BufferIO::ReadInt32(pbuf);
......@@ -1222,6 +1223,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->chain_code = code;
mainGame->dField.conti_cards.push_back(pcard);
mainGame->dField.conti_act = true;
mainGame->dField.conti_descs.insert(desc);
conti_exist = true;
} else {
pcard->chain_code = code;
......
......@@ -430,10 +430,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
select_options.clear();
for (size_t i = 0; i < activatable_cards.size(); ++i) {
if (activatable_cards[i] == clicked_card) {
if(reset_descs.find(activatable_descs[i]) != reset_descs.end())
if(conti_descs.find(activatable_descs[i]) != conti_descs.end())
continue;
if(reset_descs.find(activatable_descs[i]) != reset_descs.end()) {
if(id == BUTTON_CMD_ACTIVATE) continue;
else
} else {
if(id == BUTTON_CMD_RESET) continue;
}
select_options.push_back(activatable_descs[i]);
if (index == -1) index = i;
}
......@@ -705,6 +708,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
select_options.clear();
for (size_t i = 0; i < activatable_cards.size(); ++i) {
if (activatable_cards[i] == command_card) {
if(conti_descs.find(activatable_descs[i]) != conti_descs.end()) {
if(list_command == COMMAND_ACTIVATE) continue;
} else {
if(list_command == COMMAND_OPERATION) continue;
}
select_options.push_back(activatable_descs[i]);
if (index == -1) index = i;
}
......
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