#define DEBUG
mob
var
list/party = new/list(0=" ", 1=" ", 2=" ", 3=" ", 4=" ", 5=" ")
mob/verb
TestCreation()
var/obj/Pokemon/_001/Bulbasaur = new()
var/i
src << "Party: [party]"
for(i=0, i < 6, i++)
var/o = party[i] //line 12
if(o == " ")
break
party[i] = Bulbasaur
Problem description:
I get the runtime error message:
runtime error: cannot read from list
proc name: TestCreation (/mob/verb/TestCreation)
source file: Mob.dm,12
usr: KingCold999 (/mob)
src: KingCold999 (/mob)
call stack:
KingCold999 (/mob): TestCreation()
Whenever I try to test the verb. It should look for an open position in the list (defined by a string with a single space in it) and then place the newly created object (Bulbasaur) into it. "src << "Party: [party]"" should output "Party: /list" and doesnt, even though the list is already created and defined to have 6 indexes (0-5).
The error appears BEFORE line 12 is even ran, as it shows up before "Party: " is outputted, which makes entirely no sense whatsoever to me.
Also lists are dynamic, instead of defining size you could simply add new values into it.