ID:262918
 
This simple proc I tried to use to create a list of players. It not work!!!
proc
PlayerList()
var/list/List
for(var/mob/M in world)
if(ismob(M))
if(M.client)
List += "[M.name]"
List += "Cancel"
return List

It, at runtime, yells at me, calling M null at the if(M.client) line. WHY??? What am I doing wrong this time?

--Vito
Try changing if(ismob(M)) to if(M&&ismob(M)).

Edit:
Also, I think you need to change your var/list/L line to var/list/L = new().

Hiead
In response to Hiead (#1)
Yeah, got it working. I gotta tweak something else now in my all-day tinker spree.


--Vito