summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-06 01:51:07 -0300
committershennetsind <ind@henn.et>2013-04-06 01:51:07 -0300
commit7e35b764fac24c51f4fc4a486ef33cf97b1225cb (patch)
tree7dca8ddcf411ce2168cf73331789b632b523344c
parentdaccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0 (diff)
downloadhercules-7e35b764fac24c51f4fc4a486ef33cf97b1225cb.tar.gz
hercules-7e35b764fac24c51f4fc4a486ef33cf97b1225cb.tar.bz2
hercules-7e35b764fac24c51f4fc4a486ef33cf97b1225cb.tar.xz
hercules-7e35b764fac24c51f4fc4a486ef33cf97b1225cb.zip
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 <ind@henn.et>
-rw-r--r--src/map/battle.c3
1 files changed, 3 insertions, 0 deletions
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