client.Center() <- If it's a player attacking usr is set here to the client's mob
mob.UseWeapon() <- This step is the first in the case of an AI attacking in which case usr isn't anything
obj/getable/equipment/Weapon.UseWeapon()
atom.Dagage()
atom.Killed()
mob.dropall()
mob.drop() <- This is a verb but at this point usr isn't what I wanted!
So if the attacker was a played the attacked would have dropped all their items rather than the mob attacked if the attack was a player otherwise nothing would happen(I made some null checks so if usr was null nothing happened rather than a run-time error).
Though apparently this was just an oversight of the problem at the time I programmed CTF2 since I properly handled this in other places ie:
obj/verb/Get()
set src in view(0)
GetObj(usr)
obj/proc/GetObj(mob/who)
src.loc = who
So when an AI needs to pick up an object I call the GetObj proc directly and when a player uses the Get() verb it's just a wrapper for the GetObj() proc.
The point here is you should never have an AI character call a verb unless you don't use usr in the verb so:
mob/verb/say(msg as text)
world << "[src]: [msg]" //This is safe to call from an AI mob or maybe
//another player forcing speech on a character
mob/verb/say(msg as text)
world << "[usr]: [msg]" //This isn't safe to call from an AI mob as usr wouldn't be valid.
The point of this post being if you're calling verbs from procs you should be careful or just not use usr in those verbs. This is particularly important for handling AI since much of the functionality you may want them to have already exsist in player verbs.