1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-13 12:17:10 +00:00

Merge pull request #454 from josephcsible/noenableunlisted

Fix "disable/enable all" affecting lands not in the list
This commit is contained in:
Zeno Rogue
2025-10-13 09:17:41 +02:00
committed by GitHub

View File

@@ -1046,10 +1046,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);