summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-11 15:40:12 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-11 15:40:12 +0000
commit854bd10ed8d13fb5726f2ace998bf83908d1dad8 (patch)
treee52093e1444a8d8303e882574d95c959de9d2dc0 /src/map/mob.c
parent14f8a72627a8d64b9860a18d1154e670b615f1f2 (diff)
downloadhercules-854bd10ed8d13fb5726f2ace998bf83908d1dad8.tar.gz
hercules-854bd10ed8d13fb5726f2ace998bf83908d1dad8.tar.bz2
hercules-854bd10ed8d13fb5726f2ace998bf83908d1dad8.tar.xz
hercules-854bd10ed8d13fb5726f2ace998bf83908d1dad8.zip
* Fixed a crash when mob uses self-destruct skills (bugreport:2568) [Inkfish]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13754 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 59182fcbb..0a774fe89 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3010,10 +3010,12 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
map_search_freecell(&md->bl, md->bl.m, &x, &y, j, j, 3);
}
md->skillidx = i;
- if (!unit_skilluse_pos2(&md->bl, x, y,
- ms[i].skill_id, ms[i].skill_lv,
- ms[i].casttime, ms[i].cancel))
+ map_freeblock_lock();
+ if (!unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv, ms[i].casttime, ms[i].cancel))
+ {
+ map_freeblock_unlock();
continue;
+ }
} else {
//Targetted skill
switch (ms[i].target) {
@@ -3044,10 +3046,12 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
}
if (!bl) continue;
md->skillidx = i;
- if (!unit_skilluse_id2(&md->bl, bl->id,
- ms[i].skill_id, ms[i].skill_lv,
- ms[i].casttime, ms[i].cancel))
+ map_freeblock_lock();
+ if (!unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv, ms[i].casttime, ms[i].cancel))
+ {
+ map_freeblock_unlock();
continue;
+ }
}
//Skill used. Post-setups...
if(!(battle_config.mob_ai&0x200))
@@ -3057,6 +3061,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
md->skilldelay[j]=tick;
} else
md->skilldelay[i]=tick;
+ map_freeblock_unlock();
return 1;
}
//No skill was used.