ID:144790
 
Ok, Im having a problem making it so that only the PC's show up in a list. I have my PC's defined as 'mob/player', and the following code works fine. It only shows the players, and misses out the NPC's.
mob/verb/Online()
for(var/mob/player/M in world)
src << "[M]"


This next piece of code however is showing players and NPC's (mob/enemies) in the list, instead of just the players like I want.
mob/verb/Kill(mob/player/M in world)
M.HP = 0
M.Die()



Can anyone tell me why this is happening and what I could do to stop it. Thanks, Zythyr.
The argument to a verb can't restrict the list to a specific subtype. You can use as mob, as turf, etc. to narrow it to a particular category of atom, but you can't ensure it's a /mob/player without manually restricting the list. You can however do the latter:
var/list/players = new   // update as players log in and out

mob/verb/Kill(mob/M in players)
...

Lummox JR