ID:145391
 
Code:
mob
proc
season()
if(!season)
world << "Winter arrives with snow from the skies"
season = 1
for(var/turf/T in world)
if(T.icon_state == "grass")
T.overlays += new/turf/envoirment/snowing
sleep(200)
T.icon_state = "snowy"
sleep(900)
season()
if(season)
world << "Summer arrives with the sun shinning brightly"
season = 0
for(var/turf/envoirment/grass/T in world)
if(T.icon_state == "snowy")
T.overlays = null
sleep(100)
T.icon_state = "grass"
sleep(900)
season()


Problem description:
I get the error below when i use the admin verb to activate the season. I already tried to make it with world creation but that didnt work


runtime error: bad loc
proc name: season (/mob/proc/season)
usr: Mass (/mob)
src: Mass (/mob)
call stack:
Mass (/mob): season()
Mass (/mob): Season()

Is there anyone who can fix this?
In response to BBDragoon (#1)
Try making the second if statement to else if, not sure but I think you have a bad loop going :).
First off, try doing what derekjeterisgod said, and changing that second "if" to an "else". Secondly, I noticed that the first check statement, which reads:
for(var/turf/T in world)

Is shorter that the second one, which reads:
for(var/turf/enviornment/grass/T in world)
or something similar. Maybe you should try changing it so that they both read the same thing.
In response to Yattasparagus (#3)
tried both but didnt work still says bad loc
In response to BBDragoon (#4)
In DreamMaker;
Build -> Preferences for 'yourprojectname' -> Click 'Generate Debugging information'.
Then run again, and it'll tell you what line the error's on. Give us the code with that line in it, please.
In response to Yattasparagus (#3)
First off, try doing what derekjeterisgod said, and changing that second "if" to an "else".

Not to "else" to "else if"