Added code to resmooth loaded maps atoms.

This commit is contained in:
xxalpha
2015-12-14 01:41:18 +00:00
parent ca7aa2283b
commit 051e5b889b
2 changed files with 29 additions and 2 deletions
+28 -2
View File
@@ -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--
+1
View File
@@ -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)