ID:145200
 
Code:
    Click(atom/a)
var/obj/display/o=a
world << o.targ.type
world << ttype
world << istype(o.targ,ttype)
if(istype(o,/obj/display))
world << "Doing"
if(istype(o.targ,ttype))
world << "Boing"
if(spell) if(mob.canact)
world << "ping"
spell.Spell(mob,o.targ,ignore_mp,chargeobj)
ttype=null
spell=null
ignore_mp=null
chargeobj=null


Problem description:

This code is outputting the following:

/mob/monster/goblin
/mob
0
Doing

Surely /mob/monster/goblin is derived from /mob? This is bound to be a simple error, but I can't tell what I've done wrong.
Is ttype a type path or a string?

(You can check using istext().)
In response to Crispy
Text string.

And adding a text2path call fixed the problem. Thanks, Crispy. That was seriously puzzling me for a while.

EDIT:
"Preparing to cast Magic Missile
You fire arrows of magical energy at the goblin
You deal 10 magic damage to the goblin
You have slain the goblin
Welcome to level 2
The scroll of Magic Missile has run out of charges!"

Yay for roguelikes!