summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.