obj/Items
Candle
var
Owner
Lit = 0
icon = 'objects.dmi'
icon_state = "candle"
verb
Use()
if(Lit)
Lit = !Lit
icon_state = "candle"
usr << "You blow out the candle."
Owner = usr
else
Lit = TRUE
icon_state = "candle_lit"
usr << "You light the candle."
Owner = usr
world/New()
..()
spawn() Candles()
Candles()
while(world)
sleep(10)
for(var/area/Weather/w in world)
world << w
for(var/obj/Items/Candle/o in world)
if(o.Lit)
for(var/area/Weather/w in view(4,o.Owner))
w.icon_state="dark2"
Problem description:
For my game, I have an area called "Weather" that is every where. During the day time, it's icon_state is equal to "dark0". During the night, "dark7". I'm trying to make a simple proc that will change the Weathers that are within 4 spaces of the candle's icon_state to be equal to "dark2". I have only tried using the method above, as I cannot think of another way it can be done. Any help would be appreciated.
**EDIT**
I've debugged some and it turns out that it treats the Weather as a single instance, instead of each being a separate instance.
The Illuminated area would switch between dark0 and dark2, and the Weather area would switch between dark0 and dark7.
Also:
That's how areas work.