From 6906262e67b4f69e8ae53ddf6f44de739ec73e62 Mon Sep 17 00:00:00 2001 From: CHOMPStation2 <58959929+CHOMPStation2@users.noreply.github.com> Date: Sun, 13 Aug 2023 23:12:14 -0700 Subject: [PATCH] [MIRROR] Fixes emag modules stacking (#6780) Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: CHOMPStation2 --- 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 0c4403ee5c..114f178653 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 0568487066..19061375de 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/locked/phasegun/unlocked/mounted/cyborg/phasegun = new(src) //CHOMP Edit 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) . = ..()