diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 403d28ab774..3f5ea2dcb94 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -321,7 +321,7 @@ mymob.healths = new /obj/screen/healths() infodisplay += mymob.healths - mymob.healthdoll = new /obj/screen/healthdoll() + mymob.healthdoll = new() infodisplay += mymob.healthdoll mymob.pullin = new /obj/screen/pull() diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index c6bbbd27ae2..6c69063e0b8 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -102,7 +102,7 @@ mymob.healths = new /obj/screen/healths() infodisplay += mymob.healths - mymob.healthdoll = new /obj/screen/healthdoll() + mymob.healthdoll = new() infodisplay += mymob.healthdoll mymob.pullin = new /obj/screen/pull() diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index dc59cf16097..6fe0e4a8532 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -468,3 +468,4 @@ name = "health doll" icon_state = "healthdoll_DEAD" screen_loc = ui_healthdoll + var/list/cached_healthdoll_overlays = list() // List of icon states (strings) for overlays diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 617d63c798b..bdb64ba0a98 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -614,6 +614,8 @@ H.clear_alert("high") /datum/species/proc/handle_hud_icons(mob/living/carbon/human/H) + if(!H.client) + return if(H.healths) if(H.stat == DEAD) H.healths.icon_state = "health7" @@ -633,11 +635,15 @@ else H.healths.icon_state = "health6" if(H.healthdoll) - H.healthdoll.overlays.Cut() if(H.stat == DEAD) H.healthdoll.icon_state = "healthdoll_DEAD" + if(H.healthdoll.overlays.len) + H.healthdoll.overlays.Cut() else - H.healthdoll.icon_state = "healthdoll_OVERLAY" + var/list/new_overlays = list() + var/list/cached_overlays = H.healthdoll.cached_healthdoll_overlays + // Use the dead health doll as the base, since we have proper "healthy" overlays now + H.healthdoll.icon_state = "healthdoll_DEAD" for(var/obj/item/organ/external/O in H.organs) var/damage = O.burn_dam + O.brute_dam var/comparison = (O.max_damage/5) @@ -652,8 +658,10 @@ icon_num = 4 if(damage > (comparison*4)) icon_num = 5 - if(icon_num) - H.healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[O.limb_name][icon_num]") + new_overlays += "[O.limb_name][icon_num]" + H.healthdoll.overlays += (new_overlays - cached_overlays) + H.healthdoll.overlays -= (cached_overlays - new_overlays) + H.healthdoll.cached_healthdoll_overlays = new_overlays switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 37bb39b7754..e4765b4f106 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -22,7 +22,7 @@ */ var/obj/screen/zone_sel/zone_sel = null var/obj/screen/leap_icon = null - var/obj/screen/healthdoll = null + var/obj/screen/healthdoll/healthdoll = null var/use_me = 1 //Allows all mobs to use the me verb by default, will have to manually specify they cannot var/damageoverlaytemp = 0 diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index c3843c0c967..1957a0aa1e0 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ