But lets say you have a proc that teaches someone a skill, but only if they dont already have it, as demonstrated (badly) in the below code:
obj/Skill/Jump
mob/proc/Learn()
for(var/obj/Skill/Jump/A in contents) return
contents+=new/obj/Skill/Jump
src<<"You learned Jump"
I tried this too but it didnt work
for(!var/obj/Skill/Jump/A in contents) contents+=new/obj/Skill/Jump
But I really didn't expect it to work.
Can anyone tell me a better way to see if something is NOT in your contents and if not add that thing to your contents?
And what about:
if(!contents.Find(/obj/Skill/Jump)) contents+=new/obj/Skill/Jump
See [link] for an example of how not knowing them can do >_>
2) Maybe you want to locate(/path) in Ref.contents?
locate() returns only a single object reference, but in this case, that's alright since we only want one type.