ID:273647
 
I am wondering how i would remove overlays that are already on the players when i use a proc.e.g

mob
proc
strip()
for(var/obj/suit/S in src.contents)//checks for obj in the src copntents
if(S.worn)//if you are wearing it
S.Wear(src)//call the verb u use to wear it, and removes it from player
del(S)//then deletes it

obj
suit
verb
Wear()
if(worn)
usr.overlays-= src/icon
else
usr.overlays+= src/icon
"src/icon" is literally "src divided by icon", which is probably not what you want.

Additionally, passing src as an argument to Wear() when it isn't taking any arguments is silly.

Additionally, if you are going to use a verb as a proc (like you are here), then you need to not use usr in it. If you can't avoid using usr in it, then you need to farm off its function to another proc which takes an argument, and just have the verb (and whatever used to be calling the verb as a proc) call that. For example, you'd have:

obj/whatever
proc/Wear(var/mob/M)
if(worn)
M.overlays -= src.icon
else
M.overlays += src.icon

verb/Wear_verb()
set name = "Wear"
Wear(usr)


Oh, and if you're doing this then calling S.Wear(src) would be correct.