Make hud resize more robust for empty lists (manequins)

This commit is contained in:
Arokha Sieyes
2018-03-19 15:12:35 -04:00
parent deac68004d
commit 3350d347e6

View File

@@ -82,12 +82,13 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
size_multiplier = new_size //Change size_multiplier so that other items can interact with them size_multiplier = new_size //Change size_multiplier so that other items can interact with them
/mob/living/carbon/human/resize(var/new_size, var/animate = TRUE) /mob/living/carbon/human/resize(var/new_size, var/animate = TRUE)
if(..()) return 1 . = ..()
var/new_y_offset = 32 * (size_multiplier - 1) if(LAZYLEN(hud_list) && has_huds)
for(var/index = 1 to hud_list.len) var/new_y_offset = 32 * (size_multiplier - 1)
var/image/HI = grab_hud(index) for(var/index = 1 to hud_list.len)
HI.pixel_y = new_y_offset var/image/HI = grab_hud(index)
apply_hud(index, HI) HI.pixel_y = new_y_offset
apply_hud(index, HI)
// Optimize mannequins - never a point to animating or doing HUDs on these. // Optimize mannequins - never a point to animating or doing HUDs on these.
/mob/living/carbon/human/dummy/mannequin/resize(var/new_size) /mob/living/carbon/human/dummy/mannequin/resize(var/new_size)