ID:263385
 
Code:
mob
DblClick(mob/M)
if(istype(M,/mob/Monster))
walk_towards(usr,M,3)
else
return

mob
Monster
icon='player.dmi'
icon_state="monster"
New()
walk_rand(src,5)
..()


Problem description:
For some reason, my if(istype()) refuses to work, when it did in the past. Do I need to reinstall BYOND?
When I remove the if(istype()), the character will walk to the turf that the Monster was on when it was doubleclicked.
E.E

In DblClick(), usr is the person clicking and src is the atom being click, unless you're talking client/DblClick(). M does nothing there.
In response to CaptFalcon33035
e.e I switched it up,
mob
DblClick(mob/M)
if(istype(M,/mob/))
walk_towards(usr,src,4)
..()


but still noting. I'm not sure what I am doing wrong, since I even checked it against an old unpublished game that I have
In response to Dead_Demon
Dead_Demon wrote:
still noting. I'm not sure what I am doing wrong, since I even checked it against an old unpublished game that I have

Cap told you what was wrong. The argument of DblClick is the location where src was clicked by usr.
Format:
    DblClick(Location)
Args:
    Location: the stat panel in which the object was clicked or its location on the map.


src is the thing that was double clicked. Location, the argument, is either a turf if it was clicked on the map or text if it was clicked in a statpanel. It will never be a mob.

Your if statement is asking "Is the turf or statpanel this mob was clicked on a mob?" A turf is not a mob. Text is not a mob. So the if() always fails.

mob/Monster/DblClick() // when a mob/Monster is double clicked
// have the clicker (usr) walk towards the Monster (src)
walk_towards(usr,src,4)
..()