Commit 33c5e902 authored by DailyShana's avatar DailyShana

fix

for announcing "海"
parent 9964e4cd
......@@ -1296,7 +1296,7 @@ static bool is_declarable(T const& cd, int declarable_type) {
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::UpdateDeclarableCode() {
void ClientField::UpdateDeclarableCode(bool enter) {
const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = BufferIO::GetVal(pname);
CardString cstr;
......@@ -1308,7 +1308,7 @@ void ClientField::UpdateDeclarableCode() {
ancard.push_back(trycode);
return;
}
if(pname[0] == 0 || pname[1] == 0)
if(pname[0] == 0 || (pname[1] == 0 && !enter))
return;
mainGame->lstANCard->clear();
ancard.clear();
......
......@@ -103,7 +103,7 @@ 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 UpdateDeclarableCode();
void UpdateDeclarableCode(bool enter);
irr::gui::IGUIElement* panel;
std::vector<int> ancard;
......
......@@ -793,7 +793,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_CHANGED: {
switch(id) {
case EDITBOX_ANCARD: {
UpdateDeclarableCode();
UpdateDeclarableCode(false);
break;
}
}
......@@ -802,7 +802,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) {
case EDITBOX_ANCARD: {
UpdateDeclarableCode();
UpdateDeclarableCode(true);
break;
}
case EDITBOX_CHAT: {
......
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