Commit b6639c8e authored by fallenstardust's avatar fallenstardust

sync

parent 33f13ffa
...@@ -1478,8 +1478,23 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) { ...@@ -1478,8 +1478,23 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
ancard.push_back(trycode); ancard.push_back(trycode);
return; return;
} }
if((pname[0] == 0 || pname[1] == 0) && !enter) if((pname[0] == 0 || pname[1] == 0) && !enter) {
return; std::vector<int> cache;
cache.swap(ancard);
int sel = mainGame->lstANCard->getSelected();
int selcode = (sel == -1) ? 0 : cache[sel];
mainGame->lstANCard->clear();
for(const auto& trycode : cache) {
if(dataManager.GetString(trycode, &cstr) && dataManager.GetData(trycode, &cd) && is_declarable(cd, opcode)) {
ancard.push_back(trycode);
mainGame->lstANCard->addItem(cstr.name.c_str());
if(trycode == selcode)
mainGame->lstANCard->setSelected(cstr.name.c_str());
}
}
if(!ancard.empty())
return;
}
mainGame->lstANCard->clear(); mainGame->lstANCard->clear();
ancard.clear(); ancard.clear();
for(auto cit = dataManager._strings.begin(); cit != dataManager._strings.end(); ++cit) { for(auto cit = dataManager._strings.begin(); cit != dataManager._strings.end(); ++cit) {
......
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