From 051e5b889ba01ca031d1e281e230da30d823a1bf Mon Sep 17 00:00:00 2001 From: xxalpha Date: Mon, 14 Dec 2015 01:41:18 +0000 Subject: [PATCH] Added code to resmooth loaded maps atoms. --- code/__HELPERS/icon_smoothing.dm | 30 +++++++++++++++++++++++++++-- code/modules/awaymissions/zlevel.dm | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 6fe6880b967..8440b3380a7 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -60,7 +60,7 @@ /proc/smooth_icon(atom/A) if(qdeleted(A)) return - spawn(1) //don't remove this, otherwise smoothing breaks + spawn(0) //don't remove this, otherwise smoothing breaks if(A && A.smooth) var/adjacencies = calculate_adjacencies(A) @@ -134,7 +134,8 @@ return "4-[sdir]" /proc/smooth_icon_neighbors(atom/A) - for(var/atom/T in orange(1,A)) + for(var/V in orange(1,A)) + var/atom/T = V if(T.smooth) smooth_icon(T) @@ -189,3 +190,28 @@ return SOUTH_EAST if(SOUTHWEST) return SOUTH_WEST + +//Icon smoothing helpers +/proc/smooth_zlevel(var/zlevel) + var/list/away_turfs = block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel)) + for(var/V in away_turfs) + var/turf/T = V + if(T.smooth) + smooth_icon(T) + for(var/R in T) + var/atom/A = R + if(A.smooth) + smooth_icon(A) + +/mob/proc/resmooth(times=1) + var/list/L = block(locate(1, 1, z), locate(world.maxx, world.maxy, z)) + while(times) + for(var/V in L) + var/turf/T = V + if(T.smooth) + smooth_icon(T) + for(var/R in T) + var/atom/A = R + if(A.smooth) + smooth_icon(A) + times-- \ No newline at end of file diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index 967779fb1b8..807c8f1a291 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -39,6 +39,7 @@ var/file = file(map) if(isfile(file)) maploader.load_map(file) + smooth_zlevel(world.maxz) world.log << "away mission loaded: [map]" map_transition_config.Add(AWAY_MISSION_LIST)