Replace the code with this:

```
````
for(var/step_dir in cardinal)
    var/obj/machinery/hydroponics/t = get_step(src, step_dir)
    if(t && t.anchored && src.anchored == 2)
        n += step_dir
````