MonsterDeath(mob/M)
if(M.HP <= 0)
del(src)
Will it check to see if the monster(the thing other then usr) is dead and delete it?
ID:146932
Dec 4 2004, 5:22 pm
|
|
MonsterDeath(mob/M) Will it check to see if the monster(the thing other then usr) is dead and delete it? |
In response to Hell Ramen
|
|
mob
proc DeathCheck() if(client) usr.loc = locate(/turf/Start) world << "[usr] has been killed!" else del(src) Ok I changed it a little, Will this work? |
Loch wrote:
> MonsterDeath(mob/M) Will it check to see if the monster(the thing other then usr) is dead and delete it? I'd do this, personally, but that doesn't mean you have to: mob Yeah..passing "src" on as an argument to the proc. |
In response to Loch
|
|
use mob/proc/DeathCheck(mob/M)
The M is the killer, the src is the attacker if: you call it like: M.DeathCheck(src) [Edit]That may work, sorry if it doesn't. |
In response to Loch
|
|
Loch wrote:
mob That's the wrong way to go. The very first rule of thumb you must take to heart when programming in DM: No put usr in proc. Ungh. Besides, the victim should be src. DeathCheck() primarily affects the victim, not the killer, so it should belong to the victim. The killer is not usr, but should instead be sent as an argument. Lummox JR |
Why delete the src if it's checking the mob?