diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-25 19:12:27 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-25 19:12:27 +0000 |
commit | 2d4285b733ce76bf0bc5b5bc8f02c673d4fba887 (patch) | |
tree | 60eb5ba94a07d9403dfe0fd7db3b380e287b4f86 | |
parent | 90d466716c46d8861d85dcf377981a412a2e2267 (diff) | |
download | hercules-2d4285b733ce76bf0bc5b5bc8f02c673d4fba887.tar.gz hercules-2d4285b733ce76bf0bc5b5bc8f02c673d4fba887.tar.bz2 hercules-2d4285b733ce76bf0bc5b5bc8f02c673d4fba887.tar.xz hercules-2d4285b733ce76bf0bc5b5bc8f02c673d4fba887.zip |
- Fixed a possible crash when you dual-wield and the total damage is 0.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7880 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/battle.c | 7 |
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); |