From 13550126eb7b47995de99356ad1e3d2f01a5870a Mon Sep 17 00:00:00 2001 From: Heroman Date: Sun, 13 Aug 2023 10:22:07 +1000 Subject: [PATCH] Fixes emag modules stacking --- code/_onclick/hud/robot.dm | 10 ++++++---- .../robot/subtypes/thinktank/thinktank_module.dm | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 0c4403ee5cd..114f1786534 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -249,11 +249,13 @@ var/obj/screen/robot_inventory //be emagged before they actually select a module. - or some situation can cause them to get a new module // - or some situation might cause them to get de-emagged or something. if(r.emagged || r.emag_items) - if(!(r.module.emag in r.module.modules)) - r.module.modules.Add(r.module.emag) + for(var/obj/O in r.module.emag) + if(!(O in r.module.modules)) + r.module.modules.Add(r.module.emag) else - if(r.module.emag in r.module.modules) - r.module.modules.Remove(r.module.emag) + for(var/obj/O in r.module.emag) + if(O in r.module.modules) + r.module.modules.Remove(r.module.emag) for(var/atom/movable/A in r.module.modules) if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) diff --git a/code/modules/mob/living/silicon/robot/subtypes/thinktank/thinktank_module.dm b/code/modules/mob/living/silicon/robot/subtypes/thinktank/thinktank_module.dm index 5e64cdef759..55dbb0e79dc 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/thinktank/thinktank_module.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/thinktank/thinktank_module.dm @@ -67,7 +67,7 @@ var/obj/item/weapon/gun/energy/phasegun/mounted/cyborg/phasegun = new(src) modules += phasegun - emag = new /obj/item/weapon/chainsaw(src) + emag += new /obj/item/weapon/chainsaw(src) /obj/item/weapon/robot_module/robot/platform/explorer/respawn_consumable(var/mob/living/silicon/robot/R, rate) . = ..() @@ -93,7 +93,7 @@ modules += new /obj/item/weapon/packageWrap(src) modules += new /obj/item/weapon/pen/multi(src) modules += new /obj/item/device/destTagger(src) - emag = new /obj/item/weapon/stamp/denied + emag += new /obj/item/weapon/stamp/denied /obj/item/weapon/robot_module/robot/platform/cargo/respawn_consumable(mob/living/silicon/robot/R, rate) . = ..()