From d7734eae57eb136b6f63b70f59a3e2272009e744 Mon Sep 17 00:00:00 2001 From: Krausus Date: Mon, 4 May 2015 02:56:37 -0400 Subject: [PATCH] Fixes cyborg module cycling --- code/modules/mob/living/silicon/robot/inventory.dm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index d22976509b1..0b481630513 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -193,16 +193,17 @@ var/slot_num if(slot_start == 0) - slot_num = 1 - slot_start = 2 + slot_num = 0 + slot_start = 3 else - slot_num = slot_start + 1 + slot_num = slot_start - while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up. + do + slot_num++ + if(slot_num > 3) slot_num = 1 //Wrap around. if(module_active(slot_num)) select_module(slot_num) return - slot_num++ - if(slot_num > 3) slot_num = 1 //Wrap around. + while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up. return