Commit 26a85843 authored by VanillaSalt's avatar VanillaSalt

update

parent b85f26b1
......@@ -340,6 +340,7 @@ void ClientField::ClearCommandFlag() {
(*cit)->cmdFlag = 0;
for(cit = attackable_cards.begin(); cit != attackable_cards.end(); ++cit)
(*cit)->cmdFlag = 0;
conti_cards.clear();
deck_act = false;
extra_act = false;
grave_act = false;
......
......@@ -977,25 +977,37 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_SELECT_BATTLECMD: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf);
int /*code, */desc, count, con, loc, seq/*, diratt*/;
int code, desc, count, con, loc, seq/*, diratt*/;
ClientCard* pcard;
mainGame->dField.activatable_cards.clear();
mainGame->dField.activatable_descs.clear();
count = BufferIO::ReadInt8(pbuf);
for (int i = 0; i < count; ++i) {
/*code = */BufferIO::ReadInt32(pbuf);
code = BufferIO::ReadInt32(pbuf);
con = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
loc = BufferIO::ReadInt8(pbuf);
seq = BufferIO::ReadInt8(pbuf);
desc = BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(con, loc, seq);
int flag = 0;
if(code & 0x80000000) {
flag = EDESC_OPERATION;
code &= 0x7fffffff;
}
mainGame->dField.activatable_cards.push_back(pcard);
mainGame->dField.activatable_descs.push_back(std::make_pair(desc, 0));
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.activatable_descs.push_back(std::make_pair(desc, flag));
if(flag == EDESC_OPERATION) {
pcard->chain_code = code;
mainGame->dField.conti_cards.push_back(pcard);
mainGame->dField.conti_act = true;
pcard->cmdFlag |= COMMAND_OPERATION;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
}
}
mainGame->dField.attackable_cards.clear();
count = BufferIO::ReadInt8(pbuf);
......@@ -1106,13 +1118,25 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
seq = BufferIO::ReadInt8(pbuf);
desc = BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(con, loc, seq);
int flag = 0;
if(code & 0x80000000) {
flag = EDESC_OPERATION;
code &= 0x7fffffff;
}
mainGame->dField.activatable_cards.push_back(pcard);
mainGame->dField.activatable_descs.push_back(std::make_pair(desc, 0));
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.activatable_descs.push_back(std::make_pair(desc, flag));
if(flag == EDESC_OPERATION) {
pcard->chain_code = code;
mainGame->dField.conti_cards.push_back(pcard);
mainGame->dField.conti_act = true;
pcard->cmdFlag |= COMMAND_OPERATION;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
}
}
if(BufferIO::ReadInt8(pbuf)) {
mainGame->btnBP->setVisible(true);
......
Subproject commit 1f1d9cba25969e85760185a3fbb6f2070beba1aa
Subproject commit b12628811d5f449ab5e0b2242bfc6d474ceb5211
Subproject commit 0f2bb610e85d5d61faefbf91c6f4c5aa4e52ec3c
Subproject commit 5672ac76978214f48d297bb5c49ab9fa5b00f2ef
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