turf/Resources
Clay_Pit_Lv_0
icon = 'Turfs.dmi'
icon_state = "clay pit"
density = 0
level = 0
resclay = 3
rewood = 25
reclay = 20
reiron = 20
rewheat = 10
verb/Lv_up()
if(usr.wood < src.rewood)
src << "You need more wood."
src << "to build it."
return
if(usr.clay < src.reclay)
src << "You need more clay."
src << "to build it."
return
if(usr.iron < src.reiron)
src << "You need more iron."
src << "to build it."
return
if(usr.wheat < src.rewheat)
src << "You need more wheat."
src << "to build it."
return
else
usr.wood -= src.rewood
usr.clay -= src.reclay
usr.iron -= src.reiron
usr.wheat -= src.rewheat
src = new /turf/Resources/Clay_Pit_Lv_1 ()
Clay_Pit_Lv_1
icon = 'Turfs.dmi'
icon_state = "clay pit"
density = 0
level = 1
resclay = 5
rewood = 35
reclay = 25
reiron = 25
rewheat = 20
Problem description:
runtime error: bad loc
proc name: Lv up (/turf/Resources/Clay_Pit_Lv_0/verb/Lv_up)
source file: Clay_Pit.dm,34
usr: Prf X (/mob)
src: Clay Pit Lv 0 (10,10,2) (/turf/Resources/Clay_Pit_Lv_0)
call stack:
Clay Pit Lv 0 (10,10,2) (/turf/Resources/Clay_Pit_Lv_0): Lv up()
src = new /turf/Resources/Clay_Pit_Lv_1 ()
You aren't setting it's loc when you create it, so it shoots an error about bad loc.
Also, what you would want to be using is objects for this, since you can't delete and create turfs like you are trying to do at runtime.