 
 		push 'function applyNearRules (position) {'
 
-		push 'var inventoryItem = getInventoryItem()'
-
 		push 'getNeighbors(position).forEach((neighbor) => {'
 
-		push 'var terrainItem = getTerrainItem(neighbor)'
+		push 'const terrainItem = getTerrainItem(neighbor)'
 
 		ruleLines = makeList()
 		rules.forEach (rule) ->


		push "if (#{terrainItemCondition}) {"

		push "setTerrainItem(prevPosition, '#{resolveItem rule.outTerrainItemName}')"

		push "}"


			when '_inventory'
				'inventoryItem'
			else
				"'#{reference}'"


	makeList = ->
