Skip to content

Commit

Permalink
Fixed infinite loop when changing portal visibility without having re…
Browse files Browse the repository at this point in the history
…gions.
  • Loading branch information
oddlama committed Jun 15, 2021
1 parent 85cfd30 commit eb0e1b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ private MenuWidget menu_item_visibility(final Portal portal) {
return ClickResult.ERROR;
}

Portal.Visibility new_vis;
Portal.Visibility new_vis = portal.visibility();
// If regions is not installed, we need to skip group visibility.
do {
new_vis = event.getClick() == ClickType.RIGHT ? portal.visibility().prev() : portal.visibility().next();
new_vis = event.getClick() == ClickType.RIGHT ? new_vis.prev() : new_vis.next();
} while (new_vis.requires_regions() && !get_module().is_regions_installed());

portal.visibility(new_vis);
Expand Down

0 comments on commit eb0e1b2

Please sign in to comment.