summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-20 16:03:58 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-20 16:03:58 +0000
commit6e6ee08f7a162e128eae4e28ff983954990a2fdf (patch)
treec74931748ff989224ca109f056e9a31cf165f009 /src/map/mob.c
parent95ca50c9d1ffce386c1e91de805c816e77c45c4c (diff)
downloadhercules-6e6ee08f7a162e128eae4e28ff983954990a2fdf.tar.gz
hercules-6e6ee08f7a162e128eae4e28ff983954990a2fdf.tar.bz2
hercules-6e6ee08f7a162e128eae4e28ff983954990a2fdf.tar.xz
hercules-6e6ee08f7a162e128eae4e28ff983954990a2fdf.zip
- A mob's HP is set temporarily to 0 before invoking it's on-death script, prevents said scripts being able to "rekill" the mob indefinitely (if stuff like killmonster is used within)
- Some small cleanups in chat.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8829 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 73446d349..1a0d5c38b 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2134,12 +2134,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(md->nd)
mob_script_callback(md, src, CALLBACK_DEAD);
else if(md->npc_event[0]){
+ md->status.hp = 0; //So that npc_event invoked functions KNOW that I am dead.
if(src && src->type == BL_PET)
sd = ((struct pet_data *)src)->msd;
if(sd && battle_config.mob_npc_event_type)
npc_event(sd,md->npc_event,0);
else if(mvp_sd)
npc_event(mvp_sd,md->npc_event,0);
+ md->status.hp = 1;
} else if (mvp_sd) { //lordalfa
pc_setglobalreg(mvp_sd,"killedrid",md->class_);
if(mvp_sd->state.event_kill_mob)