anchor.diff:  	var/adjacencies = 0
   
   	if(A.can_be_unanchored)
  -		var/atom/movable/T = A
  -		if(!T.anchored)
  +		var/atom/movable/AM = A
  +		if(!AM.anchored)
   			return 0
   
   		for(var/direction in alldirs)
  -			var/atom/movable/AM = find_type_in_direction(A, direction)
  -			if(AM)
  +			AM = find_type_in_direction(A, direction)
  +			if(istype(AM))
   				if(AM.anchored)
  +					adjacencies |= transform_dir(direction)
  +			else
  +				if(AM)
   					adjacencies |= transform_dir(direction)
   	else
   		for(var/direction in alldirs)
  
positive.code: 
  /proc/smooth_icon(atom/A)
  	if(A && A.smooth)
  		clear_overlays(A)
  		var/adjacencies = calculate_adjacencies(A)
  
  		A.top_left_corner = make_nw_corner(adjacencies)
  		A.top_right_corner = make_ne_corner(adjacencies)
  
negative.code: 	else if(direction & WEST)
  		x_offset -= range
  
  	var/turf/target_turf = locate(source.x + x_offset, source.y + y_offset, source.z)
  	if(source.canSmoothWith)
  		var/atom/A
  		for(var/a_type in source.canSmoothWith)
  			if(ispath(a_type, /turf))
  				if(a_type == target_turf.type)
  					return target_turf
  			else
  				A = locate(a_type) in target_turf
  				if(A && A.type == a_type)
  					return A
  		return null
  	else
  		if(isturf(source))
  			return source.type == target_turf.type ? target_turf : null
  		var/atom/A = locate(source.type) in target_turf
  		return A && A.type == source.type ? A : null
  
  /proc/clear_overlays(atom/A)
  	A.overlays -= A.top_left_corner
  