for(var/S in typesof(/obj/items/Magic))
src.item+= S
obj/items
Magic
Bean
Rock
Grass
Problem description: Why is it when I do that it will include "Magic" in the list? Is it supposed to do this? I only wanted to include the items in Magic's string.
ID:145612
![]() Feb 5 2006, 10:04 pm
|
|
Code:
for(var/S in typesof(/obj/items/Magic)) Problem description: Why is it when I do that it will include "Magic" in the list? Is it supposed to do this? I only wanted to include the items in Magic's string. |
![]() Feb 5 2006, 10:48 pm
|
|
try
|
A.T.H.K wrote:
try > for(var/S in typesof(/obj/Magic)) That wouldn't and doesn't make a diffrence because it is essiently doing the same exact thing. |
Texter wrote:
Code: for(var/S in typesof(/obj/items/Magic)) Problem description: Why is it when I do that it will include "Magic" in the list? Is it supposed to do this? I only wanted to include the items in Magic's string. Try adding a "/" to the end of Magic in the first line. |
It's because you're not filtering /obj/Magic from the list. You can try typesof(/obj/Magic/), but it may not work. Your best bet is to use for(var/M in typesof(/obj/Magic/)-/obj/Magic)
|