ID:268947
 
var/list/q = list(icon_states(src.armor.icon))
if(q.Find("q"))//It's in there
world << "Q"//Returns nothing

Of course, the obj that armor is set to exists. And the icon_state is there, yet it returns nothing...please help me.
Thanks for reading.
simple,youve defined it as q,when the message has Q.
and you also need for it to have [] around it,[q].

var/list/q = list(icon_states(src.armor.icon))
if(q.Find("q"))//It's in there
world << "[q]"//Returns nothing

In response to Hiddeknight
No...it doesn't find the icon_state...so I'm using it wrong somewhere.
Just what excatly is src.armor? I mean how is it defined?
In response to DeathAwaitsU
mob/var/equipment/armor
(Note: Equipment is an obj typepath)
In response to Hell Ramen
Ok I just tried it on my own and this seems to work if the icon has the icon state:

mob/var/obj/armor/P

mob
verb
listy()
usr.P = new
usr.P.icon = 'Numbers.dmi'
var/list/q = list()
var/x = icon_states(usr.P.icon)
q += x
if(q.Find("tan"))
world << "Owned"
The only reason that that wouldn't work is if src.armor doesn't exist or that its icon is null. Try this:
var/list/q = list(icon_states(src.armor.icon))
world << "Armor Icon: [src.armor.icon]"
if(q.Find("q"))//It's in there
world << "Q"//Returns nothing
In response to Wizkidd0123
It returns the icon...yet, it doesn't do anything...
icon_states() returns a list. When you declare q, you're put that list inside another list. =)

var/list/q = list(icon_states(src.armor.icon))
var/list/q = icon_states(src.armor.icon)
In response to YMIHere
Thanks YMIhere. :)
In response to DeathAwaitsU
This works because you create an empty list, then add the other list to it. With BYOND's += operator handling lists being added to other list differently than objects being added to lists, you end up with an exact copy of what icon_states() returns. =)
In response to YMIHere
So is there anything wrong with the way I did it(minus the extra lines of coding)?
In response to DeathAwaitsU
DeathAwaitsU wrote:
So is there anything wrong with the way I did it(minus the extra lines of coding)?

I don't think so...but I didn't try it. You were sending a list to a non-list.
In response to DeathAwaitsU
Correct, I was just pointing out why yours worked and his didn't. =)