Fix conflicts between helmet/mech HUDs and HUD glasses

This commit is contained in:
oranges
2017-11-16 15:39:15 -06:00
committed by CitadelStationBot
parent 0e0eb351b3
commit 952fa2a0f2
5 changed files with 39 additions and 18 deletions
+2 -6
View File
@@ -444,7 +444,6 @@
icon_state = "hardsuit0-rd"
item_color = "rd"
resistance_flags = ACID_PROOF | FIRE_PROOF
var/onboard_hud_enabled = 0 //stops conflicts with another diag HUD
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
armor = list(melee = 30, bullet = 5, laser = 10, energy = 5, bomb = 100, bio = 100, rad = 60, fire = 60, acid = 80)
var/obj/machinery/doppler_array/integrated/bomb_radar
@@ -457,16 +456,13 @@
/obj/item/clothing/head/helmet/space/hardsuit/rd/equipped(mob/living/carbon/human/user, slot)
..()
if(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic))
to_chat(user, ("<span class='warning'>Your [user.glasses] prevents you using [src]'s diagnostic visor HUD.</span>"))
else
onboard_hud_enabled = 1
if (slot == slot_head)
var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC]
DHUD.add_hud_to(user)
/obj/item/clothing/head/helmet/space/hardsuit/rd/dropped(mob/living/carbon/human/user)
..()
if(onboard_hud_enabled && !(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic)))
if (user.head == src)
var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC]
DHUD.remove_hud_from(user)