summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-18 19:43:31 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-18 19:43:31 +0000
commit3b6d997be930fd60c3e1f519f44b83aa1acbbca9 (patch)
treeb34bc290a504a6d59fe193ac522784ecab260ce2 /src/map/battle.c
parentf541d307ada85d57093a34ed4155fb4439258cda (diff)
downloadhercules-3b6d997be930fd60c3e1f519f44b83aa1acbbca9.tar.gz
hercules-3b6d997be930fd60c3e1f519f44b83aa1acbbca9.tar.bz2
hercules-3b6d997be930fd60c3e1f519f44b83aa1acbbca9.tar.xz
hercules-3b6d997be930fd60c3e1f519f44b83aa1acbbca9.zip
fixed mapserv crash (divide by zero in Earthquake)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12618 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 19ccf23f5..ae8f13c17 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2346,7 +2346,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
if (skill_num == NPC_EARTHQUAKE)
{ //Adds atk2 to the damage, should be influenced by number of hits and skill-ratio, but not mdef reductions. [Skotlex]
//Also divide the extra bonuses from atk2 based on the number in range [Kevin]
- ad.damage+= (sstatus->rhw.atk2*skillratio/100)/mflag;
+ if(mflag>0)
+ ad.damage+= (sstatus->rhw.atk2*skillratio/100)/mflag;
+ else
+ ShowError("Zero range by %d:%s, divide per 0 avoided!\n", skill_num, skill_get_name(skill_num));
}
if(ad.damage<1)