ID:261576
 
        if(istype(src,/obj)) world.log << "obj created"
light = new /light (null)
light.calibrate()
if(istype(src,/obj)) world.log << "hit target 1"
..()
if(istype(src,/obj)) world.log << "hit target 2"
spawn(1)
if(istype(src,/obj)) world.log << "hit target 3"
for(var/atom/A in range(50))
A.light.calibrate_projection()
if(istype(src,/obj)) world.log << "calibrating [A]..."


The above is a troubled code snippet. On my map, I have 10 squares x 10 squares of turfs and an obj in the top half. When I run the proc that triggers the snippet above, this is the output I get:

obj created
hit target 1
hit target 2
hit target 3

I don't get any calibrating messages! I promise you that there are atoms in range(50). Is there any reason that they shouldn't be registering? Now, the bizzaire thing is that you get the calibrating messages if you replace all the type checks to /mob instead of /obj. Bizzaire!
Your problem might be that range doesn't support numbers as high as 50. Its maximum is 2*world.view. You can use block(), instead.

-AbyssDragon
In response to AbyssDragon
That wouldn't work because block() only returns turfs (I want a proc that returns all atoms, and range() is the answer to that.)

I know that range() is limited to world.maxx*2 or whatever, but it still returns everything if you are a mob... however, it returns nothing if you are anything BUT a mob! That's what is so wierd, and that's what my problem is.

-LoW

P.S. Just to make sure I was in the right about the range() thing, I increased the map size to 25x25. No luck! :-(
In response to Lord of Water
Any chance that this is a BYOND bug of some sort? I've talked to a few people and tried a ton of things (including putting debugging lines between every line) to no avail. I've pinpointed the error being the for() statement... it returns nothing at all unless src is a mob!

-Lord of Water
In response to Lord of Water
Maybe you need an as statement such as,
for(var/atom/A as mob|turf|obj|area in range(src,50))
range(50) has another argument, the center point, which defaults to usr. usr, of course, is always a mob... I think in the act of creating a mob, the mob that is returned will be the usr for any procs subsequently called. An obj, on the other hand, can never be the usr, so whatever it's trying to find range(50) for, it's not your obj.
In response to Lesbian Assassin
I had told him the same thing via AIM, I figured he was using range like we use view(), but view()'s center arg is automatically set as usr if nothing is given and range()'s is not. He did not tell me if it did anything so I can't say much else.