mob/proc/FillMine()
set background=1
var/turf/T=pick(/turf/mine/stone/Slate, /turf/mine/stone/Chert,/turf/mine/stone/Chalk,/turf/mine/stone/Schist,/turf/mine/stone/Sandstone,/turf/mine/stone/Limestone)
var/xx
var/yy
var/xsize=1
var/ysize=1
var/zz=2
var/typ=1
for(zz=2,zz<=5,zz++)
for(xx=1,xx<=1000,xx+=xsize)
for(yy=1,yy<=1000,yy+=ysize)
typ=pick(prob(70,1),prob(25,2),prob(5,3))
if(typ==1)
xsize=rand(8,44)
ysize=rand(8,44)
T=pick(/turf/mine/stone/Slate, /turf/mine/stone/Claystone,/turf/mine/stone/Coal,/turf/mine/stone/Diorite,/turf/mine/stone/Gabbro,/turf/mine/stone/Marble,/turf/mine/stone/Granite,/turf/mine/stone/Chert,/turf/mine/stone/Chalk,/turf/mine/stone/Schist,/turf/mine/stone/Sandstone,/turf/mine/stone/Limestone)
for(var/turf/W in block(locate(xx,yy,zz),locate(min(xx+xsize,1000),min(yy+ysize,1000),zz)))
if(T) new T(locate(W.x,W.y,W.z))
if(typ==2)
xsize=rand(6,25)
ysize=rand(6,25)
T=pick(prob(40,/turf/mine/ore/Iron),prob(24,/turf/mine/ore/Copper),prob(24,/turf/mine/ore/Tin),prob(2,/turf/mine/ore/Gold),prob(4,/turf/mine/ore/Silver),prob(4,/turf/mine/ore/Mithril),prob(1,/turf/mine/ore/Platinum),prob(1,/turf/mine/ore/Adamantite))
for(var/turf/W in block(locate(xx,yy,zz),locate(min(xx+xsize,1000),min(yy+ysize,1000),zz)))
if(T) new T(locate(W.x,W.y,W.z))
if(typ==3)
xsize=rand(1,3)
ysize=rand(1,3)
T=pick(prob(6,/turf/mine/precious/Diamond),prob(13,/turf/mine/precious/Agate),prob(12,/turf/mine/precious/Citrine),prob(8,/turf/mine/precious/Emerald),prob(10,/turf/mine/precious/Onyx),prob(20,/turf/mine/precious/Quartz),prob(8,/turf/mine/precious/Ruby),prob(8,/turf/mine/precious/Sapphire),prob(15,/turf/mine/precious/Sard))
for(var/turf/W in block(locate(xx,yy,zz),locate(min(xx+xsize,1000),min(yy+ysize,1000),zz)))
if(T) new T(locate(W.x,W.y,W.z))
Above is the code, here is the error message...
runtime error: BYOND BUG: bad turf
proc name: FillMine (/mob/proc/FillMine)
source file: water.dm,454
usr: Minsc (/mob/PC)
src: Minsc (/mob/PC)
call stack:
Minsc (/mob/PC): FillMine()
Minsc (/mob/PC): GenWorld(Minsc (/mob/PC))
Minsc (/mob/PC): GenerateWorld()
Here is the exact line of code it points too,
if(T) new T(locate(W.x,W.y,W.z))
This error is highly random, sometimes it happens, sometimes it does not.
The error message is one of the most useless I have ever seen, what the hell is a bad turf? Why is it bad? What makes it bad? How the hell can it be fixed?
Someone explain this to me, because this has to be the most annoying error I have ever encountered.
Strangely enough, if I remove all areas from the world (except for /area), this error never happens, ever.