From d1df5e17553699a4e91508c41623894aeae1a310 Mon Sep 17 00:00:00 2001 From: Cruix Date: Mon, 2 Oct 2023 21:21:31 -0700 Subject: [PATCH] Fixed spritesheet images for sprite accessories with no icon_state (#78710) ## About The Pull Request Some sprite accessories (such as bald and shaved) do not have icon states, and these are stored as nulls in the GLOB lists. When generating sprite sheets, nulls were simply returning the basic head icon without scaling it in the same manner as the other sprites were scaled. Old: ![Before](https://github.com/tgstation/tgstation/assets/16478175/e095dd8b-2fc2-4f7b-a176-7f0684629428) New: ![after](https://github.com/tgstation/tgstation/assets/16478175/ea5b4583-58c5-42de-b5ea-367661ebb9e9) ## Why It's Good For The Game Having some hairstyles be scaled differently in the spritesheets looks bad. ## Changelog :cl: fix: Some icons for selecting character preferences are no longer scaled incorrectly. /:cl: Co-authored-by: Cruix --- .../client/preferences/species_features/basic.dm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/code/modules/client/preferences/species_features/basic.dm b/code/modules/client/preferences/species_features/basic.dm index faa86cc07e2..6e34a234e7d 100644 --- a/code/modules/client/preferences/species_features/basic.dm +++ b/code/modules/client/preferences/species_features/basic.dm @@ -4,16 +4,13 @@ head_icon = icon('icons/mob/human/bodyparts_greyscale.dmi', "human_head_m") head_icon.Blend(skintone2hex("caucasian1"), ICON_MULTIPLY) - if (isnull(sprite_accessory)) - return head_icon - - ASSERT(istype(sprite_accessory)) - var/icon/final_icon = new(head_icon) + if (!isnull(sprite_accessory)) + ASSERT(istype(sprite_accessory)) - var/icon/head_accessory_icon = icon(sprite_accessory.icon, sprite_accessory.icon_state) - head_accessory_icon.Blend(COLOR_DARK_BROWN, ICON_MULTIPLY) - final_icon.Blend(head_accessory_icon, ICON_OVERLAY) + var/icon/head_accessory_icon = icon(sprite_accessory.icon, sprite_accessory.icon_state) + head_accessory_icon.Blend(COLOR_DARK_BROWN, ICON_MULTIPLY) + final_icon.Blend(head_accessory_icon, ICON_OVERLAY) final_icon.Crop(10, 19, 22, 31) final_icon.Scale(32, 32)