ID:271458
 
Here is my code:
for(var/turf/T in block(locate(P.x-8,P.y-8,P.z),locate(P.x+8,P.y,P.z)))

When the code runs in the dream seeker, it's not finding the turfs, but when I use numbers in the locate() proc, it finds the turfs.


For example if I did this:
for(var/turf/T in block(locate(1,1,1),locate(17,8,1))

It would work fine, but I want it to search the block of turfs dynamically, but it just won't work.


Smokey Joe wrote:
Here is my code:
> for(var/turf/T in block(locate(P.x-8,P.y-8,P.z),locate(P.x+8,P.y,P.z)))
>

When the code runs in the dream seeker, it's not finding the turfs, but when I use numbers in the locate() proc, it finds the turfs.


For example if I did this:
> for(var/turf/T in block(locate(1,1,1),locate(17,8,1))
>

It would work fine, but I want it to search the block of turfs dynamically, but it just won't work.



That should work... Maybe tell us what P is in your code? For example, if P is an obj in something's contents, then it has no x,y, or z coordinates.
In response to Dragonn
Objects have x,y and z.
P was /mob/player/P

And I figured it out, the locate() proc was going out of the map boundries which caused an error.
In response to Smokey Joe
Thus why you should use the min() and max() procs

http://bwicki.byond.com/ByondBwicki.dmb?MinMax