mob
var
corpse = /obj/corpse
Die()
new corpse(src.loc) //create the corpse here
del src
spider
corpse = /obj/corpse/spider
frog
corpse = /obj/corpse/frog
What would be different if in the code, it were "corpse = obj/corpse" instead of "corpse = /obj/corpse"?
Reason I ask this is because I have an istype error where it returns if the src isn't istype(/obj/Perk). Even when I placed a / path operator before the obj where my big obj/Perk object tree is, it still returned where
if(!istype(P, /obj/Perk)) return //P is true though, so no need to pay attention to that as far as I know
The problem you're having is that istype() takes an object reference as its first argument, not a string. The ispath() proc is what you're after.
But in cases when you're setting a variable to a type-path, you rarely need to actually check it directly, the usage is usually something along the lines of what the reference entry shows where you're creating something of that type.
You'd really have to show what you're doing with your 'P' variable to know what the issue is you're having. Is it an object or a type?