From 22ae87c376a22bad62facb285f74060b6cc1884d Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 26 Mar 2017 16:34:47 -0500 Subject: [PATCH] Fixes a bug with meatbrain FBPs. --- .../mob/living/carbon/human/update_icons.dm | 28 +++++++------------ code/modules/organs/organ_icon.dm | 5 ++-- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index cf62e394f0..a6267a8d00 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -2,7 +2,7 @@ Global associative list for caching humanoid icons. Index format m or f, followed by a string of 0 and 1 to represent bodyparts followed by husk fat hulk skeleton 1 or 0. TODO: Proper documentation - icon_key is [species.race_key][g][husk][fat][hulk][skeleton][model][s_tone] + icon_key is [species.race_key][g][husk][fat][hulk][skeleton][s_tone] */ var/global/list/human_icon_cache = list() var/global/list/tail_icon_cache = list() //key is [species.race_key][r_skin][g_skin][b_skin] @@ -242,22 +242,7 @@ var/global/list/damage_icon_parts = list() if(gender == FEMALE) g = "female" - var/model = "1" - for(var/organ_tag in species.has_limbs) - var/obj/item/organ/external/part = organs_by_name[organ_tag] - if(isnull(part) || part.is_stump()) - model = "0" - continue - if(part) - if(part.robotic >= ORGAN_ROBOT) - model = "2[part.model ? "-[part.model]": ""]" - else if(part.status & ORGAN_DEAD) - model = "3" - else - model = "1" - - - var/icon_key = "[species.get_race_key(src)][g][model][s_tone][r_skin][g_skin][b_skin]" + var/icon_key = "[species.get_race_key(src)][g][s_tone][r_skin][g_skin][b_skin]" if(lip_style) icon_key += "[lip_style]" else @@ -276,7 +261,7 @@ var/global/list/damage_icon_parts = list() if(part) icon_key += "[part.species.get_race_key(part.owner)]" icon_key += "[part.dna.GetUIState(DNA_UI_GENDER)]" - icon_key += "[part.dna.GetUIValue(DNA_UI_SKIN_TONE)]" + icon_key += "[part.s_tone]" if(part.s_col && part.s_col.len >= 3) icon_key += "[rgb(part.s_col[1],part.s_col[2],part.s_col[3])]" if(part.body_hair && part.h_col && part.h_col.len >= 3) @@ -284,6 +269,13 @@ var/global/list/damage_icon_parts = list() else icon_key += "#000000" + if(part.robotic >= ORGAN_ROBOT) + icon_key += "2[part.model ? "-[part.model]": ""]" + else if(part.status & ORGAN_DEAD) + icon_key += "3" + else + icon_key += "1" + icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]" var/icon/base_icon diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index cc4844e200..3c975067a2 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -114,6 +114,7 @@ var/global/list/limb_icon_cache = list() mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") else if (robotic >= ORGAN_ROBOT) mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + apply_colouration(mob_icon) else mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]") apply_colouration(mob_icon) @@ -135,8 +136,6 @@ var/global/list/limb_icon_cache = list() return mob_icon /obj/item/organ/external/proc/apply_colouration(var/icon/applying) - if(robotic == ORGAN_ROBOT) - return applying if(nonsolid) applying.MapColors("#4D4D4D","#969696","#1C1C1C", "#000000") @@ -195,7 +194,7 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F if(!icon_cache_key || !limb_icon_cache[cache_key]) limb_icon_cache[cache_key] = icon(get_icon(), null, SOUTH) var/image/temp = image(limb_icon_cache[cache_key]) - if((robotic == ORGAN_ROBOT) && species) + if((robotic < ORGAN_ROBOT) && species) // Calculate the required colour matrix. var/r = 0.30 * species.health_hud_intensity var/g = 0.59 * species.health_hud_intensity