From 6f604aae9eaf43f700a60b1ba7fe2c5017f85320 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 26 Nov 2023 16:07:47 +0100 Subject: [PATCH] moved return to top, emag handling --- code/modules/admin/verbs/modify_robot.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm index 484c88e87c..918beb68de 100644 --- a/code/modules/admin/verbs/modify_robot.dm +++ b/code/modules/admin/verbs/modify_robot.dm @@ -9,6 +9,9 @@ if(!istype(target)) return + if(!target.module.modules) + return + var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE) var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options) @@ -38,21 +41,19 @@ if(!istype(add_item, /obj/item/)) break to_chat(usr, "You added [add_item] to [target]") + robot.module.emag.Remove(add_item) robot.module.modules.Remove(add_item) robot.module.contents.Remove(add_item) target.module.modules.Add(add_item) target.module.contents.Add(add_item) robot.Destroy() if(MODIFIY_ROBOT_MODULE_REMOVE) - if(!target.module.modules) - return while(TRUE) var/list/active_modules = target.module.modules - if(target.emagged || target.emag_items) - active_modules += target.module.emag var/selected_module_module = tgui_input_list(usr, "Please select the modules to remove", "Modules", active_modules) if(!istype(selected_module_module, /obj/item/)) break + target.module.emag.Remove(selected_module_module) target.module.modules.Remove(selected_module_module) target.module.contents.Remove(selected_module_module) qdel(selected_module_module)