summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-17 20:24:45 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-17 20:24:45 +0000
commit055c7a233509bbb724df98c049ffe65addffc97d (patch)
tree13cba2e817eeca893586b442f7f23905e2b0b13a /src
parent52e68dbe1533b916cab84e0e1e3f825f81e6153e (diff)
downloadhercules-055c7a233509bbb724df98c049ffe65addffc97d.tar.gz
hercules-055c7a233509bbb724df98c049ffe65addffc97d.tar.bz2
hercules-055c7a233509bbb724df98c049ffe65addffc97d.tar.xz
hercules-055c7a233509bbb724df98c049ffe65addffc97d.zip
- Fixed a couple of crashes that could ensue from the last memory corruption fix to free'ing clones.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13787 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index dc2533672..6fe109536 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3070,6 +3070,9 @@ int mobskill_event(struct mob_data *md, struct block_list *src, unsigned int tic
{
int target_id, res = 0;
+ if(md->bl.prev == NULL || md->status.hp <= 0)
+ return 0;
+
target_id = md->target_id;
if (!target_id || battle_config.mob_changetarget_byskill)
md->target_id = src->id;
@@ -3289,7 +3292,7 @@ int mob_clone_delete(struct mob_data *md)
aFree(mob_db_data[class_]);
mob_db_data[class_]=NULL;
//Clear references to the db
- md->db = NULL;
+ md->db = mob_dummy;
md->vd = NULL;
return 1;
}