From 56b362557e5a5f8c1450058fc9e0ef4891473821 Mon Sep 17 00:00:00 2001
From: Colin Okay <okay@toyful.space>
Date: Sat, 23 Jul 2022 13:48:25 -0500
Subject: [fix] ensure unit menu membership matches scene inclusion

---
 gui/menus.lisp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gui/menus.lisp b/gui/menus.lisp
index 2a2e938..2bc5c22 100644
--- a/gui/menus.lisp
+++ b/gui/menus.lisp
@@ -44,13 +44,16 @@
 (defmethod add-menu-option ((menu menu) option)
   (setf (unit-region option) (unit-region menu))
   (setf (menu-options menu)
-        (nconc (menu-options menu) (list option))))
+        (nconc (menu-options menu) (list option)))
+  (when (unit-in-scene-p menu)
+    (add-unit option)))
 
 (defun remove-menu-option (menu option)
   (when (member option (menu-options menu))
     (setf (unit-region option) *application*)
     (setf (menu-options menu)
-          (delete option (menu-options menu)))))
+          (delete option (menu-options menu)))
+    (drop-unit option)))
 
 (defmethod render ((menu menu))
   (dolist (o (menu-options menu))
-- 
cgit v1.2.3