diff --git a/menus.cpp b/menus.cpp index 6274d7c5..a966b0bb 100644 --- a/menus.cpp +++ b/menus.cpp @@ -38,19 +38,26 @@ void showOverview() { generateLandList(isLandIngame); + bool not_in_game = false; + if(dialog::infix != "") { - vector filtered; - for(eLand l: landlist) { + auto land_matches = [] (eLand l) { string s = dnameof(l); s += "@"; s += dnameof(treasureType(l)); s += "@"; s += dnameof(nativeOrbType(l)); - if(dialog::hasInfix(s)) - filtered.push_back(l); - } - if(filtered.size()) + return dialog::hasInfix(s); + }; + + vector filtered; + for(eLand l: landlist) if(land_matches(l)) filtered.push_back(l); + if(filtered.size()) landlist = filtered; + else { + for(int i=0; i