ID:153060
 
In the guide, it states that if a variable is to hold a datum reference, its type needs to be defined; as in obj/O. What if I had a procedure that needed to be able to receive multiple datum types as arguments? For example, if I had a command that the GM could use on either a /mob/player or a /mob/npc, how would I reference it?

Am I expected to maybe do something like have a /mob/active/player and /mob/active/npc instead, and simply use the var mob/active to accept both as an argument? Anything similar between players and npcs would obviously be declared on the mob/active type. Or, is there another way to do it?

=$= Big J Money =$=
you can have something like:
proc
something(atom/a)
if(istype(a,/mob/player))
var/mob/player/p = a
p.kill()
else if(istype(a,/obj/item))
var/obj/item/i = a
i.doSomething()

you can send the proc anything and it will check what type of object it is, and make a new variable to reference that object according to the type of the object passed to it.