From 6b1f934f873b860a62a8fe3bf66b375f2e30800e Mon Sep 17 00:00:00 2001 From: KeiKun Date: Thu, 31 Dec 2020 09:53:34 +0800 Subject: [PATCH] Fixed damage overflow on GN_CART_TORNADO. --- src/map/battle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/map/battle.c b/src/map/battle.c index e496d785321..17a61da6d08 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2661,7 +2661,9 @@ static int battle_calc_skillratio(int attack_type, struct block_list *src, struc case GN_CART_TORNADO: { int strbonus = bst->str; - skillratio = 50 * skill_lv + (sd ? sd->cart_weight : battle_config.max_cart_weight) / 10 / max(150 - strbonus, 1) + 50 * (sd ? pc->checkskill(sd, GN_REMODELING_CART) : 5); + if (strbonus > 130) //Max base stat limit on official is 130. So well allow no higher then 130 STR here. This limit prevents + strbonus = 130; //the division from going any lower then 20 so the server wont divide by 0 if someone has 150 STR. [Rytech] + skillratio = 50 * skill_lv + (sd ? sd->cart_weight : battle_config.max_cart_weight) / 10 / (150 - strbonus) + 50 * (sd ? pc->checkskill(sd, GN_REMODELING_CART) : 5); } break; case GN_CARTCANNON: