From 3c36c1acfca9011b9754cfea80fbfde8f046a3c4 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Tue, 24 Apr 2018 05:21:04 -0700 Subject: [PATCH 1/2] GetFlatIcon fix (#37371) --- code/__HELPERS/icons.dm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 4d41539be1..7caa28642e 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -762,6 +762,19 @@ world else curdir = A.dir + //Try to remove/optimize this section ASAP, CPU hog. + //Determines if there's directionals. + if(!noIcon && curdir != SOUTH) + var/exist = FALSE + var/static/list/checkdirs = list(NORTH, EAST, WEST) + for(var/i in checkdirs) //Not using GLOB for a reason. + if(length(icon_states(icon(curicon, curstate, i)))) + exist = TRUE + break + if(!exist) + base_icon_dir = SOUTH + // + if(!base_icon_dir) base_icon_dir = curdir @@ -879,7 +892,6 @@ world #undef BLANK #undef SET_SELF - #undef APPLY_SELF_COLOR /proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A.