Accessing individual list items in Developer Help
|
|
I'm trying to get the hang of lists but I still can't get how to access an individual item in a list.
mob/verb/list_add(mob/m) if(m.ingroup==0) friend1.Add(m) m.ingroup=1 while(1) var/mob/x=friend1[1] var/mob/y=friend1[2] if(src.loc==locate(12,6,1) && x in friend1 && y in friend1) x.loc(locate(12,3,1)) y.loc(locate(11,9,1)) cancelfor=1 if(cancelfor==0 && x in friend1 && src.loc==locate(12,6,1)) x.loc=locate(12,3,1) sleep(10)
|
alternatively i tried
friend1[2]=new(locate(11,9,1))
|
and that didn't work either.
|
EDIT: Also, this isn't going to work: