From b13d50594dfcab888e754cb9ff82d1d5916cb0b2 Mon Sep 17 00:00:00 2001 From: fernerr <35879136+fernerr@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:13:35 +0200 Subject: [PATCH] Fixes mechs constructed from the ground up using the incorrect layers (#10001) --- code/modules/heavy_vehicle/components/frame.dm | 10 ++++++---- code/modules/heavy_vehicle/mech_icon.dm | 1 + .../Ferner-200915-bugfix_mechconstructionicons.yml | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/Ferner-200915-bugfix_mechconstructionicons.yml diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm index 1c4ee829f18..63c333f09f9 100644 --- a/code/modules/heavy_vehicle/components/frame.dm +++ b/code/modules/heavy_vehicle/components/frame.dm @@ -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) diff --git a/code/modules/heavy_vehicle/mech_icon.dm b/code/modules/heavy_vehicle/mech_icon.dm index 1ca7ca5b5e5..7b0f219a884 100644 --- a/code/modules/heavy_vehicle/mech_icon.dm +++ b/code/modules/heavy_vehicle/mech_icon.dm @@ -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) diff --git a/html/changelogs/Ferner-200915-bugfix_mechconstructionicons.yml b/html/changelogs/Ferner-200915-bugfix_mechconstructionicons.yml new file mode 100644 index 00000000000..5ec2f01e43b --- /dev/null +++ b/html/changelogs/Ferner-200915-bugfix_mechconstructionicons.yml @@ -0,0 +1,4 @@ +author: Ferner +delete-after: True +changes: + - bugfix: "Mechs constructed from the ground up now layer its parts correctly." \ No newline at end of file