summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-02 01:56:56 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-02 01:56:56 +0000
commite28801d3e47703d7c49e3e4b6eb016fb87f099f3 (patch)
tree56e763d40287402efede7d7d9e65a25527ddefa9 /src/map/battle.c
parent54612a5d361582d6a4307c173ad58bea7ff27743 (diff)
downloadhercules-e28801d3e47703d7c49e3e4b6eb016fb87f099f3.tar.gz
hercules-e28801d3e47703d7c49e3e4b6eb016fb87f099f3.tar.bz2
hercules-e28801d3e47703d7c49e3e4b6eb016fb87f099f3.tar.xz
hercules-e28801d3e47703d7c49e3e4b6eb016fb87f099f3.zip
Fixed a damage underflow (bugreport:3624)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14077 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b80616803..b65a5fcde 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1840,12 +1840,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
}
if (def1 > 100) def1 = 100;
ATK_RATE2(
- flag.idef ?100:
- (flag.pdef ?flag.pdef *(def1 + vit_def):
- 100-def1),
- flag.idef2?100:
- (flag.pdef2?flag.pdef2*(def1 + vit_def):
- 100-def1)
+ flag.idef ?100:(flag.pdef ?(int)(flag.pdef *(def1+vit_def)):(100-def1)),
+ flag.idef2?100:(flag.pdef2?(int)(flag.pdef2*(def1+vit_def)):(100-def1))
);
ATK_ADD2(
flag.idef ||flag.pdef ?0:-vit_def,