In the past I have accomplished this by looping on the list and setting a flag if I encounter the desired obj type.
flag = 0
for(var/obj/typeX/X in LIST)
flag = 1
break
if(flag)
// blah blah
However, this seems pretty inefficient, so I'm looking for an easier method. I tried the following, but I get a compile error (error:var/obj/typeX/X:undefined var):
if(var/obj/typeX/X in LIST)
// blah blah
What is the best way to accomplish this?
ID:148763
Oct 10 2002, 8:29 am
|
|
Oct 10 2002, 8:34 am
|
|