summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
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 91db3202c..6836aa016 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3750,7 +3750,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
md.damage = 0;
if (tsd) md.damage>>=1;
#endif
- if (md.damage < 0 || md.damage > INT_MAX>>1)
+ // Some monsters have totaldef higher than md.damage in some cases, leading to md.damage < 0
+ if( md.damage < 0 )
+ md.damage = 0;
+ if( md.damage > INT_MAX>>1 )
//Overflow prevention, will anyone whine if I cap it to a few billion?
//Not capped to INT_MAX to give some room for further damage increase.
md.damage = INT_MAX>>1;