Commit 366bdc0a authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents 6e8c69af 9edf6ab7
......@@ -1451,7 +1451,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
return cd.code == CARD_MARINE_DOLPHIN || cd.code == CARD_TWINKLE_MOSS
|| (!cd.alias && (cd.type & (TYPE_MONSTER + TYPE_TOKEN)) != (TYPE_MONSTER + TYPE_TOKEN));
}
void ClientField::UpdateDeclarableCodeType(bool enter) {
void ClientField::UpdateDeclarableCodeType() {
const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = BufferIO::GetVal(pname);
CardString cstr;
......@@ -1464,9 +1464,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
return;
}
bool try_cache = false;
if(pname[0] == 0 || pname[1] == 0) {
if(!enter)
return;
if(pname[0] == 0) {
try_cache = true;
}
mainGame->lstANCard->clear();
......@@ -1498,7 +1496,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
}
}
}
void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
void ClientField::UpdateDeclarableCodeOpcode() {
const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = BufferIO::GetVal(pname);
CardString cstr;
......@@ -1511,9 +1509,7 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
return;
}
bool try_cache = false;
if(pname[0] == 0 || pname[1] == 0) {
if(!enter)
return;
if(pname[0] == 0) {
try_cache = true;
}
mainGame->lstANCard->clear();
......@@ -1545,11 +1541,11 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
}
}
}
void ClientField::UpdateDeclarableCode(bool enter) {
void ClientField::UpdateDeclarableCode() {
if(opcode.size() == 0)
UpdateDeclarableCodeType(enter);
UpdateDeclarableCodeType();
else
UpdateDeclarableCodeOpcode(enter);
UpdateDeclarableCodeOpcode();
}
void ClientField::RefreshCardCountDisplay() {
ClientCard* pcard;
......
......@@ -113,9 +113,9 @@ public:
void check_sel_sum_t(const std::set<ClientCard*>& left, int acc);
bool check_sum(std::set<ClientCard*>::const_iterator index, std::set<ClientCard*>::const_iterator end, int acc, int count);
void UpdateDeclarableCodeType(bool enter);
void UpdateDeclarableCodeOpcode(bool enter);
void UpdateDeclarableCode(bool enter);
void UpdateDeclarableCodeType();
void UpdateDeclarableCodeOpcode();
void UpdateDeclarableCode();
void RefreshCardCountDisplay();
......
......@@ -3606,7 +3606,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
mainGame->gMutex.Lock();
mainGame->ebANCard->setText(L"");
mainGame->wANCard->setText(textBuffer);
mainGame->dField.UpdateDeclarableCode(true);
mainGame->dField.UpdateDeclarableCode();
mainGame->PopupElement(mainGame->wANCard);
mainGame->gMutex.Unlock();
return false;
......@@ -3633,7 +3633,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
}
case MSG_ANNOUNCE_CARD_FILTER: {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadUInt8(pbuf);
mainGame->dField.declarable_type = 0;
mainGame->dField.opcode.clear();
for (int i = 0; i < count; ++i)
......@@ -3645,7 +3645,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len, bool retry) {
mainGame->gMutex.Lock();
mainGame->ebANCard->setText(L"");
mainGame->wANCard->setText(textBuffer);
mainGame->dField.UpdateDeclarableCode(true);
mainGame->dField.UpdateDeclarableCode();
mainGame->PopupElement(mainGame->wANCard);
mainGame->gMutex.Unlock();
return false;
......
......@@ -962,7 +962,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_CHANGED: {
switch(id) {
case EDITBOX_ANCARD: {
UpdateDeclarableCode(false);
UpdateDeclarableCode();
break;
}
}
......@@ -971,7 +971,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) {
case EDITBOX_ANCARD: {
UpdateDeclarableCode(true);
UpdateDeclarableCode();
break;
}
}
......
......@@ -779,7 +779,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
case MSG_ANNOUNCE_NUMBER:
case MSG_ANNOUNCE_CARD_FILTER: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadUInt8(pbuf);
pbuf += 4 * count;
return ReadReplayResponse();
}
......
......@@ -1354,7 +1354,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_ANNOUNCE_NUMBER:
case MSG_ANNOUNCE_CARD_FILTER: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadUInt8(pbuf);
pbuf += 4 * count;
WaitforResponse(player);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
......
......@@ -698,7 +698,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case MSG_ANNOUNCE_NUMBER:
case MSG_ANNOUNCE_CARD_FILTER: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadUInt8(pbuf);
pbuf += 4 * count;
if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) {
mainGame->singleSignal.Reset();
......
......@@ -1426,7 +1426,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_ANNOUNCE_NUMBER:
case MSG_ANNOUNCE_CARD_FILTER: {
player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadUInt8(pbuf);
pbuf += 4 * count;
WaitforResponse(player);
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
......
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