From ddf8fdc06b7e0f4a5884b9cfd063780d2e95bb2b Mon Sep 17 00:00:00 2001 From: JimTheCactus Date: Thu, 31 Jul 2014 18:33:56 -0600 Subject: [PATCH] Modified function such that the atom isn't used in the defaults. This caused the routine to crash when the atom didn't have an icon or was null. --- code/__HELPERS/icons.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index e7a6bbba964..a7560129420 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -635,7 +635,7 @@ The _flatIcons list is a cache for generated icon files. */ proc // Creates a single icon from a given /atom or /image. Only the first argument is required. - getFlatIcon(image/A, defdir=A.dir, deficon=A.icon, defstate=A.icon_state, defblend=A.blend_mode) + getFlatIcon(image/A, defdir=2, deficon=null, defstate=null, defblend=null) // We start with a blank canvas, otherwise some icon procs crash silently var/icon/flat = icon('icons/effects/effects.dmi', "icon_state"="nothing") // Final flattened icon if(!A) @@ -672,10 +672,13 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu curdir = defdir var/curblend - if(A.blend_mode == BLEND_DEFAULT) - curblend = defblend + if(A.blend_mode) + if(A.blend_mode == BLEND_DEFAULT) + curblend = defblend + else + curblend = A.blend_mode else - curblend = A.blend_mode + curblend = defblend // Layers will be a sorted list of icons/overlays, based on the order in which they are displayed var/list/layers = list()