summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/battle.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 89de5f334..1fc0d23f4 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/07/25
+ * Fixed a possible crash when you dual-wield and the total damage is 0.
+ [Skotlex]
* Added Toms's perl scripts item_db.pl and mob_db.pl (they are in tools/),
they convert the txt databases into sql. [Skotlex]
- Usage: "script" < "input file" > "output file". eg: ./tools/item_db.pl < db/item_db.txt > sql-files/item_db.sql
diff --git a/src/map/battle.c b/src/map/battle.c
index bbee2fe24..72d9cddf1 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1944,8 +1944,8 @@ static struct Damage battle_calc_weapon_attack(
if(!flag.lh && wd.damage2)
wd.damage2=0;
- if(wd.damage > 0 || wd.damage2 > 0)
- {
+ if(wd.damage + wd.damage2)
+ { //There is a total damage value
if(!wd.damage2) {
wd.damage=battle_calc_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag);
if (map_flag_gvg(target->m))
@@ -1955,8 +1955,7 @@ static struct Damage battle_calc_weapon_attack(
wd.damage2=battle_calc_damage(src,target,wd.damage2,wd.div_,skill_num,skill_lv,wd.flag);
if (map_flag_gvg(target->m))
wd.damage2=battle_calc_gvg_damage(src,target,wd.damage2,wd.div_,skill_num,skill_lv,wd.flag);
- }
- else
+ } else
{
int d1=wd.damage+wd.damage2,d2=wd.damage2;
wd.damage=battle_calc_damage(src,target,d1,wd.div_,skill_num,skill_lv,wd.flag);