From 7e35b764fac24c51f4fc4a486ef33cf97b1225cb Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 6 Apr 2013 01:51:07 -0300 Subject: Fixed Bug #7089 Special Thanks to KyleZ, jTynne, mkbu95 http://hercules.ws/board/tracker/issue-7089-server-crashed-by-16-garment/ Signed-off-by: shennetsind --- src/map/battle.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/map/battle.c b/src/map/battle.c index d2156058d..1b9d5a94b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3229,6 +3229,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list * Pierce defence gains 1 atk per def/2 **/ + if( def1 == -400 ) /* being hit by a gazillion units, you hit the jackpot and got -400 which creates a division by 0 and subsequently crashes */ + def1 = -399; + ATK_ADD2( flag.pdef ?(def1/2):0, flag.pdef2?(def1/2):0 -- cgit v1.2.3-60-g2f50