1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-10 21:29:03 +00:00

Fix "disable/enable all" affecting lands not in the list

This commit is contained in:
Joseph C. Sible
2025-09-14 21:54:06 -04:00
parent 8b7e82b460
commit c9bb1ddfd7

View File

@@ -1042,10 +1042,11 @@ EX void customize_land_list() {
if(use_custom_land_list) {
dialog::addItem("disable/enable all", 'D');
dialog::add_action([] {
std::vector<eLand> ll(landlist);
dialog::add_action([ll] {
int qty = 0;
for(int i=0; i<landtypes; i++) if(custom_land_list[i]) qty++;
for(int i=0; i<landtypes; i++) custom_land_list[i] = !qty;
for(eLand l: ll) if(custom_land_list[l]) qty++;
for(eLand l: ll) custom_land_list[l] = !qty;
});
}
else dialog::addBreak(100);