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 /src | |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 7 |
1 files changed, 3 insertions, 4 deletions
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); |