[MIRROR] improved robot HUD handling (#7381)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
CHOMPStation2
2023-12-09 16:32:40 -07:00
committed by GitHub
parent 4185f52a96
commit 8c8f025be3
3 changed files with 12 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
if(!check_rights(R_ADMIN))
return
if(!istype(target))
if(!istype(target) || !target.module)
return
if(!target.module.modules)
@@ -45,6 +45,7 @@
robot.module.contents.Remove(add_item)
target.module.modules.Add(add_item)
target.module.contents.Add(add_item)
target.hud_used.update_robot_modules_display()
to_chat(usr, "<span class='danger'>You added \"[add_item]\" to [target].</span>")
if(istype(add_item, /obj/item/stack/))
var/obj/item/stack/item_with_synth = add_item
@@ -94,6 +95,8 @@
if(!istype(selected_module_module, /obj/item/))
break
to_chat(usr, "<span class='danger'>You removed \"[selected_module_module]\" from [target]</span>")
target.uneq_all()
target.hud_used.update_robot_modules_display(TRUE)
target.module.emag.Remove(selected_module_module)
target.module.modules.Remove(selected_module_module)
target.module.contents.Remove(selected_module_module)