[MIRROR] Fixes emag modules stacking (#6780)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
CHOMPStation2
2023-08-13 23:12:14 -07:00
committed by GitHub
parent 0078d339cc
commit 6906262e67
2 changed files with 8 additions and 6 deletions

View File

@@ -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) )