From 38edbe0269e08d6d2f229e9b6045f1f7776255cf Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Thu, 23 Jul 2020 06:39:40 -0400 Subject: [PATCH] Merge pull request #52416 from MrMelbert/testedCode Fixes cyborg cycling (and a runtime with uneq_active) --- code/modules/mob/living/silicon/robot/inventory.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index e7bed84146c..bc4a13b95d4 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -246,10 +246,11 @@ break /** - * Unequips the active held item. + * Unequips the active held item, if there is one. */ /mob/living/silicon/robot/proc/uneq_active() - unequip_module_from_slot(module_active, get_selected_module()) + if(module_active) + unequip_module_from_slot(module_active, get_selected_module()) /** * Unequips all held items. @@ -326,6 +327,7 @@ if(module_active != held_items[module_num]) inv3.icon_state = "[initial(inv3.icon_state)] +a" module_active = held_items[module_num] + return TRUE /** * Deselects the module in the slot module_num. @@ -344,6 +346,7 @@ if(module_active == held_items[module_num]) inv3.icon_state = initial(inv3.icon_state) module_active = null + return TRUE /** * Toggles selection of the module in the slot module_num.