world
New()
..()
sleep(1)
var/savefile/F = new("lists.sav")
Immortals = new()
F["immortals"] >> Immortals
if(length(Immortals)==0)
world << "Immortals created"
Immortals += HEAD_ADMIN
Immortals += "DummyAdmin"
if(HEAD_ADMIN in Immortals) world << "[HEAD_ADMIN] added to Immortals"
else world << "[HEAD_ADMIN] NOT added to Immortals"
if("DummyAdmin" in Immortals) world << "DummyAdmin added to Immortals"
else world << "DummyAdmin NOT added to Immortals"
Immortals["[HEAD_ADMIN]"] =4
Immortals["DummyAdmin"] =4
F["immortals"] << Immortals
else
world << "Immortals exists, and contains : "
for(var/a in Immortals)
world << "\t [a] (Immortals)"
world << "\t [Immortals[a]] (Immortals)"
It generates the following output :
Alathon isnt in Immortals
runtime error: bad index
proc name: New (/world/New)
source file: Immortal_System.dm,90
usr: null
src:
call stack:
: New()
Immortals created
Alathon NOT added to Immortals
DummyAdmin NOT added to Immortals
The only way I see this happening is if it never actually adds anything to the Immortals list, but I don't see how it wouldn't? I get the feeling it has something to do with this line (F["immortals"] >> Immortals) but Im not sure if its changing the list to a string or something else somehow.
Thanks,
Alathon
Edit : By the by, line 90 is Immortals["[HEAD_ADMIN]"] =4
and yes I know why it generates that runtime error(Incase someone is thinking I am asking why its giving that error)
Immortals = new()
Maybe:
var/list/Immortals = list()
would work better?
-Lord of Water, trying to be helpful