Fixes mechs constructed from the ground up using the incorrect layers (#10001)

This commit is contained in:
fernerr
2020-09-15 11:13:35 +02:00
committed by GitHub
parent 8e82a9af00
commit b13d50594d
3 changed files with 11 additions and 4 deletions
@@ -62,14 +62,16 @@
/obj/structure/heavy_vehicle_frame/update_icon()
var/list/new_overlays = get_mech_icon(list(body, head), MECH_BASE_LAYER)
//As mech icons uses a caching system, any changes here, particularly to layers, must be reflected in /mob/living/heavy_vehicle/update_icon().
var/list/new_overlays = get_mech_icon(list(body), MECH_BASE_LAYER)
if(body)
density = TRUE
overlays += get_mech_image("[body.icon_state]_cockpit", body.icon, body.color)
if(body.pilot_coverage < 100 || body.transparent_cabin)
new_overlays += get_mech_image("[body.icon_state]_open_overlay", body.icon, body.color)
new_overlays += get_mech_image("[body.icon_state]_cockpit", body.on_mech_icon, MECH_BASE_LAYER)
else
density = FALSE
if(head)
new_overlays += get_mech_image("[head.icon_state]", head.on_mech_icon, head.color, MECH_HEAD_LAYER)
new_overlays += get_mech_image("[head.icon_state]_eyes", head.on_mech_icon, null, MECH_EYES_LAYER)
if(arms)
new_overlays += get_mech_image(arms.icon_state, arms.on_mech_icon, arms.color, MECH_ARM_LAYER)
if(legs)
+1
View File
@@ -20,6 +20,7 @@ proc/get_mech_icon(var/list/components = list(), var/overlay_layer = FLOAT_LAYER
return all_images
/mob/living/heavy_vehicle/update_icon()
//As mech icons uses a caching system, any changes here, particularly to layers, must be reflected in /obj/structure/heavy_vehicle_frame/update_icon().
var/list/new_overlays = get_mech_icon(list(body), MECH_BASE_LAYER)
if(body && !hatch_closed)
new_overlays += get_mech_image("[body.icon_state]_cockpit", body.on_mech_icon, MECH_BASE_LAYER)