ID:272702
 
Well, i was programming when i decided to re-do my game's attack proc. I got in this conflict.


mob
player
verb
Attack()
var/mob/player/M=locate(/mob)in get_step(usr,usr.dir)//mainly here is my problem i can handle the rest
//i am using a different path for the ai, i know it will give me
//undefined vars, as the variables (health, level, etc) are under
//the /mob/player var?, any suggestion on how to fix this?
//unless putting vars under the /mob path?
Just check for a /mob on a for() loop or use a for() loop for a mob and use istype() to check for the desired type.
In response to Andre-g1
And after using istype() to check if the mob is a player/AI, typecast.