From 2e036c6efe5d68d4d89a9b1c46b31835d33cee12 Mon Sep 17 00:00:00 2001 From: Leonid Skorospelov Date: Sat, 30 Oct 2021 13:23:30 +0000 Subject: [PATCH] Fix MenuOptionChooseEvent not being fired from client (#6265) --- core/src/mindustry/ui/Menus.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ui/Menus.java b/core/src/mindustry/ui/Menus.java index 016b3416c0..2503e60535 100644 --- a/core/src/mindustry/ui/Menus.java +++ b/core/src/mindustry/ui/Menus.java @@ -31,9 +31,11 @@ public class Menus{ @Remote(targets = Loc.both, called = Loc.both) public static void menuChoose(@Nullable Player player, int menuId, int option){ - if(player != null && menuId >= 0 && menuId < menuListeners.size){ + if(player != null){ Events.fire(new MenuOptionChooseEvent(player, menuId, option)); - menuListeners.get(menuId).get(player, option); + if(menuId >= 0 && menuId < menuListeners.size){ + menuListeners.get(menuId).get(player, option); + } } }