From 39bb97c96288dd38e406affe4264f84a3a135ce7 Mon Sep 17 00:00:00 2001 From: LuzZza Date: Wed, 18 Apr 2007 17:00:54 +0000 Subject: Added MEXP overflow checks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10287 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/mob.c b/src/map/mob.c index 2b92438c3..e211faf2e 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3321,7 +3321,10 @@ int mob_parse_dbrow(char** str) status_calc_misc(&data.bl, status, db->lv); // MVP EXP Bonus, Chance: MEXP,ExpPer - db->mexp = atoi(str[30]) * battle_config.mvp_exp_rate / 100; + // Some new MVP's MEXP multipled by high exp-rate cause overflow. [LuzZza] + exp = (double)atoi(str[30]) * (double)battle_config.mvp_exp_rate / 100.; + db->mexp = (unsigned int)cap_value(exp, 0, UINT_MAX); + db->mexpper = atoi(str[31]); //Now that we know if it is an mvp or not, apply battle_config modifiers [Skotlex] -- cgit v1.2.3-70-g09d2