summaryrefslogtreecommitdiff
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
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
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/mob.c17
2 files changed, 13 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 364ff309e..2042ea1f2 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -2,6 +2,8 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+09/05/11
+ * Fixed a crash when mob uses self-destruct skill (bugreport:2874) [Inkfish]
09/05/10
* Magnetic Earth will never stack (bugreport:2568) [Inkfish]
* Fixed Joint Beat incorrect DEF reduction (bugreport:3051) [Inkfish]
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.