ID:138928
 
Code:
mob/verb/TestAura()
var/obj/E = /obj/skillcard/Ultimate_Aura
usr.SkillList=new/list()//To empty the list
if(!E in usr.SkillList)//If it's not in list
world<<"Pass"
usr.SkillList.Add(new/obj/skillcard/Ultimate_Aura)
else
world<<"Thar - [E] - [usr.SkillList]"
if(E in usr.SkillList)//If it is in list
world<<"Pass"
usr.SkillList.Add(new/obj/skillcard/Ultimate_Aura)
else
world<<"Thar - [E] - [usr.SkillList]"

mob/var/list/SkillList = list()


Problem description:
For some reason, these are both outputting the same thing! I can't get one to break through to pass. I originally wanted to see if it was not in the list to add it in the list, so the second if() else statement was just a check, and they both are giving me the same results... logically, it should be impossible right? Here's the output:

Thar - /obj/skillcard/Ultimate_Aura - /list
Thar - /obj/skillcard/Ultimate_Aura - /list

What's up with this? I checked the reference and couldn't find anything helpful.
Order of operation. You need to do...

if(!(E in usr.SkillList))
In response to LordAndrew (#1)
Thanks. Didn't realize that.

EDIT: But now it passes everytime, even though I took out the the new list.
In response to LordAndrew (#1)
mob/verb/TestAura()
if(!(new/obj/skillcard/Ultimate_Aura in usr.SkillList))//If it's not in list
world<<"Pass"
usr.SkillList.Add(new/obj/skillcard/Ultimate_Aura)
else
world<<"Thar"


Passes every time, so if the skill is in there, it puts in there twice... which is why I have this system... is what's not in the if() statement not the same as as what's in the Add() proc?
In response to Ganing (#3)
<dm>
if(locate(type path) in list)
if(!(locate(type path) in list))