Przeglądaj źródła

Fixed the 'exp calculation overflow fix' from r10291 which wasn't really working properly.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13265 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 16 lat temu
rodzic
commit
bf913cb3ba
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      src/map/pc.c

+ 4 - 4
src/map/pc.c

@@ -4334,7 +4334,7 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi
 	if (sd->expaddrace[status->race])
 		bonus += sd->expaddrace[status->race];	
 	bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
-	
+
 	if (battle_config.pk_mode && 
 		(int)(status_get_lv(src) - sd->status.base_level) >= 20)
 		bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]	
@@ -4344,9 +4344,9 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi
 
 	if (!bonus)
 	  	return;
-	
-	*base_exp += (unsigned int) cap_value((double)*base_exp * bonus/100., 1, UINT_MAX);
-	*job_exp += (unsigned int) cap_value((double)*job_exp * bonus/100., 1, UINT_MAX);
+
+	*base_exp = (unsigned int) cap_value(*base_exp + (double)*base_exp * bonus/100., 1, UINT_MAX);
+	*job_exp = (unsigned int) cap_value(*job_exp + (double)*job_exp * bonus/100., 1, UINT_MAX);
 
 	return;
 }