Deposit
var/list/Veins
New(Vein)
Veins = new()
..()
Veins += Vein
var/rich = round(rand(1, 3),1)
var/size = round(rand(5,25),1)
var/list/Prev = list(Vein)
var/list/Temp = list()
for(size,size>0,size--)
if(!Prev || !Prev.len) break
for(var/i=1,i<=Prev.len,i++)
if(pick(rich,0,0))
for(rich,rich>0,rich--)
for(var/n=8, n>0, n--)
if(!Prev || !Prev.len)
world.log << "No Prev!"
return
else
world.log << "[Prev.len] Prev!"
if(i > Prev.len)
world.log << "[i] > [Prev.len]!"
return
else
world.log << "[i] < [Prev.len]"
sleep(2)
for(var/p in Prev) world.log << p
var/turf/T = pick(oview(1,Prev[i]))
if(T && !T.contents.len)
var/obj/Vein/V = new(T, src)
Temp += V
break
else
for(var/n=8, n>0, n--)
if(!Prev || !Prev.len)
world.log << "No Prev!"
return
else
world.log << "[Prev.len] Prev!"
if(i > Prev.len)
world.log << "[i] > [Prev.len]!"
return
else
world.log << "[i] < [Prev.len]"
sleep(2)
for(var/p in Prev) world.log << p
var/turf/T = pick(oview(1,Prev[i]))
if(T && !T.contents.len)
var/obj/Vein/V = new(T, src)
Temp += V
break
Prev += Temp
Temp = new()
world.log << "DONE!"
obj
Vein
icon = 'grass.dmi'
icon_state = "vein"
var
Deposit/Load
New(Loc, Depo)
if(istype(Depo,/Deposit)) src.Load = Depo
else InitDeposit()
..()
proc
InitDeposit()
var/Deposit/Depo = new(src)
src.Load = Depo
Problem description: Create an instance of a Vein in the map and run. It goes along fine for a while, then spits out a List Index Out of Bounds error. I don't see how it could be out of bounds with all the checks before it. HELP!
Lummox JR