obj/Fire
proc
Spread(turf/Grass/M)
sleep(10)
if(M.flamable)
for(var/turf/T in range(1, src))
if(T.flamable && !(locate(/obj/Fire)) in T)
new /obj/Fire (T)
New()
..()
src.Spread(src.loc)
turf
Grass
icon = 'Ground.dmi'
icon_state = "Grass"
flamable = 1
verb
Light()
set src in oview(0)
var/obj/Fire/F = new
F.loc = usr.loc
turf/var/flamable = 0
Problem description:
Whenever I run this code it comes up with this error:
runtime error: Cannot read null.flamable
proc name: Spread (/obj/Fire/proc/Spread)
usr: ADT_CLONE (/mob)
src: Fire (/obj/Fire)
call stack:
Fire (/obj/Fire): Spread(null)
Fire (/obj/Fire): New()
Grass (2,1,1) (/turf/Grass): Light()
When you click on light it creates a fire underneath you and every second it trys to create another fire in a square next to it if it can.
!(locate(/obj/Fire)) in T
...should be:
!(locate(/obj/Fire) in T)
Always put parentehses around an expression that uses the in operator, if it's part of another expression like a complex if() statement.
Lummox JR