client/Click(mob/O)
//if they already have a target, remove that target.
if(usr.target != "")
O.overlays -= image('target.dmi')
usr.target=""
//if what they clicked is a mob
if(istype(O,/mob/))
//if they clicked themselves
if(O == usr)
world<<"Coo coo cachu!"
//Otherwise, set the mob to the persons target
else
world<<"Moo!"
O.overlays += image('target.dmi')
usr.target=O
world<<"[usr.target]"
//if they clicked an object, let them know. And target it.
if(istype(O,/obj/))
world<<"LOL!"
O.overlays += image('target.dmi', icon_state="object")
Problem description:
If you have something targeted, and then you decide to target something else, the previous target still has the target icon overtop of it.
You are just subtracting from the current target, not the old target.