ID:1279099
 
BYOND Version:499
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 27.0.1453.94
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary: When the torch is created and spots ANY firepits (even more than 4 blocks) it will change the icon_state to 3.

Code Snippet (if applicable) to Reproduce Problem:
obj
torch
name="Torch"
icon='building.dmi'
icon_state="torch"
density=TRUE
New()
..()
while(src)
for(var/obj/firepit/II in view(4,src.loc))
II.icon_state="3"
sleep(10)


Expected Results:
View should be limiting the distance to only 4 not the entire map area.
maybe try within view of the object, and not the turf

also, is II a type of firepit? if so, you need an extra /variable_name
nope just the var for the icon_state change. I did try it as for(var/obj/firepit/II in view(4,src)) which totally breaks it and does not even attempt to work.
hmm, maybe try some debug output...

while(src)
world << "x=[src.x],y=[src.y]"
for(var/obj/firepit/f in view(4, src))
world << "f=[f],f.x = [f.x], f.y = [f.y]"
world << "get_dist() = [get_dist(src,f)]"
sleep(10)


If you get weird results, try spawning the while()
for(var/obj/firepit/f in view(4, src))

it has to be for(var/obj/firepit/f in view(4, src.loc)) or it refuses to do anything.
Now you've lost me, I'd need to understand what area/inside is at this point...

Also, any distance checks against an /area are guaranteed to have weird results (or even fail?)

Looping inside New() is a bad idea. For the sake of helping to find the problem, it'd be beneficial to rule out bad ideas, even for the sake of strictly looking at functionality.
I meant it to be the firepit ha! I do not know what is going on either. Ill just stop at the idea i was doing. :P and try something else