Fix conflicts between helmet/mech HUDs and HUD glasses

This commit is contained in:
oranges
2017-11-17 10:38:44 +13:00
committed by CitadelStationBot
parent 0e0eb351b3
commit 952fa2a0f2
5 changed files with 39 additions and 18 deletions
+10 -8
View File
@@ -31,11 +31,10 @@ GLOBAL_LIST_INIT(huds, list(
/datum/atom_hud/proc/remove_hud_from(mob/M)
if(!M)
return
if(src in M.permanent_huds)
return
for(var/atom/A in hudatoms)
remove_from_single_hud(M, A)
hudusers -= M
if (!--hudusers[M])
hudusers -= M
for(var/atom/A in hudatoms)
remove_from_single_hud(M, A)
/datum/atom_hud/proc/remove_from_hud(atom/A)
if(!A)
@@ -54,9 +53,12 @@ GLOBAL_LIST_INIT(huds, list(
/datum/atom_hud/proc/add_hud_to(mob/M)
if(!M)
return
hudusers[M] = TRUE
for(var/atom/A in hudatoms)
add_to_single_hud(M, A)
if (!hudusers[M])
hudusers[M] = 1
for(var/atom/A in hudatoms)
add_to_single_hud(M, A)
else
hudusers[M]++
/datum/atom_hud/proc/add_to_hud(atom/A)
if(!A)