From 285df0d994453443a491bc1199a83e93aa7a3f00 Mon Sep 17 00:00:00 2001 From: KasparoVy <12377767+KasparoVy@users.noreply.github.com> Date: Sun, 25 Aug 2019 22:29:16 -0400 Subject: [PATCH] Fixes Inhand Sprite Sheeting Bug Caused by #11978, the bug presented where a species that was in the sprite_sheets of an item but didn't have a custom inhand item for it picked up an item like a uniform and suddenly a grey jumpsuit was rendered on them. Happened for Vox when picking up regular uniforms because they have species-specific uniform sprites but not species-specific inhands, so it triggered the conditional and caused silly issues. --- code/game/objects/items.dm | 1 + code/modules/mob/living/carbon/human/update_icons.dm | 8 ++++---- code/modules/projectiles/guns/alien.dm | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 8390ed664f1..2f57723f996 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -87,6 +87,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d If index term exists and icon_override is not set, this sprite sheet will be used. */ var/list/sprite_sheets = null + var/list/sprite_sheets_inhand = null //Used to override inhand items. Use a single .dmi and suffix the icon states inside with _l and _r for each hand. var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc. var/sprite_sheets_obj = null //Used to override hardcoded clothing inventory object dmis in human clothing proc. diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 83d77896459..fbe139782a8 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -1020,9 +1020,9 @@ var/global/list/damage_icon_parts = list() t_state = r_hand.icon_state var/mutable_appearance/standing - if(r_hand.sprite_sheets && r_hand.sprite_sheets[dna.species.name]) + if(r_hand.sprite_sheets_inhand && r_hand.sprite_sheets_inhand[dna.species.name]) t_state = "[t_state]_r" - standing = mutable_appearance(r_hand.sprite_sheets[dna.species.name], "[t_state]", layer = -R_HAND_LAYER) + standing = mutable_appearance(r_hand.sprite_sheets_inhand[dna.species.name], "[t_state]", layer = -R_HAND_LAYER) else standing = mutable_appearance(r_hand.righthand_file, "[t_state]", layer = -R_HAND_LAYER) standing = center_image(standing, r_hand.inhand_x_dimension, r_hand.inhand_y_dimension) @@ -1039,9 +1039,9 @@ var/global/list/damage_icon_parts = list() t_state = l_hand.icon_state var/mutable_appearance/standing - if(l_hand.sprite_sheets && l_hand.sprite_sheets[dna.species.name]) + if(l_hand.sprite_sheets_inhand && l_hand.sprite_sheets_inhand[dna.species.name]) t_state = "[t_state]_l" - standing = mutable_appearance(l_hand.sprite_sheets[dna.species.name], "[t_state]", layer = -L_HAND_LAYER) + standing = mutable_appearance(l_hand.sprite_sheets_inhand[dna.species.name], "[t_state]", layer = -L_HAND_LAYER) else standing = mutable_appearance(l_hand.lefthand_file, "[t_state]", layer = -L_HAND_LAYER) standing = center_image(standing, l_hand.inhand_x_dimension, l_hand.inhand_y_dimension) diff --git a/code/modules/projectiles/guns/alien.dm b/code/modules/projectiles/guns/alien.dm index 36bba8f3112..d9f149b3b17 100644 --- a/code/modules/projectiles/guns/alien.dm +++ b/code/modules/projectiles/guns/alien.dm @@ -80,7 +80,7 @@ ammo_type = list(/obj/item/ammo_casing/energy/sonic) cell_type = /obj/item/stock_parts/cell/super restricted_species = list(/datum/species/vox/armalis) - sprite_sheets = list("Vox Armalis" = 'icons/mob/species/armalis/held.dmi') + sprite_sheets_inhand = list("Vox Armalis" = 'icons/mob/species/armalis/held.dmi') //Big guns big birds. /obj/item/gun/energy/noisecannon/update_icon() return