ID:145190
 
Code:
mob
verb
Attack(mob/M in oview(1))
set category="Taijutsu"
set name="Punch"
if(M in get_step(usr,dir))
if(!M)return
view(3)<<"[usr] attacks [M]"
M.health-=usr.strength
usr.deathcheck(M)




mob
proc/deathcheck(mob/M)
world<<"[src] : [M]"
if(M.health<=0)
if(M.Yen>=1&&M.client)
src<<"<b>You gained [M.Yen] Yen!</b>"
src.Yen+=M.Yen
src.exp+=M.exp
M.exp=M.exp/3
src.levelup()
else
if(!M.client)
src.exp+=M.exp
src<<"<b>You gain [M.expnext] exp!</b>"
src<<"<b>You killed [M]!</b>"
src.levelup()
del(M)
else
M.createcorpse()
sleep(10)
M << sound(null)
if(M.village=="Leaf")
M.loc = locate(/turf/leafspawn)
if(M.village=="Mist")
M.loc = locate(/turf/mistspawn)
if(M.village=="Sand")
M.loc = locate(/turf/sandspawn)
M.health=M.maxhealth
world<<"<u>News.</u>[M] was killed by [src]!"
M.finish=0
M.move=0


Problem description:
The person dying is not going to their spawn point. How can I fix this? and yes the turf is on the map.
Your deathcheck is backwards
And if that doesn't work, just use the coordinates
And also, text2path() is a lovely thing, those if()s can be easily replaced.
In response to Mysame
Mysame wrote:
Your deathcheck is backwards

What do you mean?
Should it be M.deathcheck(src)?

And if that doesn't work, just use the coordinates
Okay.

And also, text2path() is a lovely thing, those if()s can be easily replaced.

Thanks for the idea.
In response to XzDoG
XzDoG wrote:
Mysame wrote:
Your deathcheck is backwards

What do you mean?
Should it be M.deathcheck(src)?

I think he means that DeathCheck() should belong to the mob that's dying. So it would be src.DeathCheck(M), where src is dying and M is the thing that killed it!
In response to Foomer
Ergh, I dont wanna reprogram my deathcheck again! :( Is there anyway to just fix it how it is?
In response to XzDoG
I think you just replace all the M's with src, unless you actually used src in there somewhere, which I don't think you did.