Bläddra i källkod

- Fixed setting setting SP_BASELEVEL

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5245 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 år sedan
förälder
incheckning
72f625000d
2 ändrade filer med 11 tillägg och 16 borttagningar
  1. 2 0
      Changelog-Trunk.txt
  2. 9 16
      src/map/pc.c

+ 2 - 0
Changelog-Trunk.txt

@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/02/09
+	* Fixed "set baselevel, X" sending one to a different level than the one
+	  requested. [Skotlex]
 	* Added range checking to mob skill loading of permillage and delay to
 	  prevent overflows. [Skotlex]
 	* Fixed pc_gainexp not working for next level exp requirements above

+ 9 - 16
src/map/pc.c

@@ -5782,9 +5782,9 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
 
 	switch(type){
 	case SP_BASELEVEL:
-		if ((val+ sd->status.base_level) > pc_maxbaselv(sd)) //Capping to max
-			val = pc_maxbaselv(sd) - sd->status.base_level;
-		if (val > (int)sd->status.base_level) {
+		if (val > pc_maxbaselv(sd)) //Capping to max
+			val = pc_maxbaselv(sd);
+		if (val > sd->status.base_level) {
 			for (i = 1; i <= (val - (int)sd->status.base_level); i++)
 				sd->status.status_point += (sd->status.base_level + i + 14) / 5 ;
 		}
@@ -5801,22 +5801,15 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
 		if (val >= (int)sd->status.job_level) {
 			if (val > pc_maxjoblv(sd)) val = pc_maxjoblv(sd);
 			sd->status.skill_point += (val-sd->status.job_level);
-			sd->status.job_level = val;
-			sd->status.job_exp = 0;
-			clif_updatestatus(sd, SP_JOBLEVEL);
-			clif_updatestatus(sd, SP_NEXTJOBEXP);
-			clif_updatestatus(sd, SP_JOBEXP);
 			clif_updatestatus(sd, SP_SKILLPOINT);
-			status_calc_pc(sd, 0);
 			clif_misceffect(&sd->bl, 1);
-		} else {
-			sd->status.job_level = val;
-			sd->status.job_exp = 0;
-			clif_updatestatus(sd, SP_JOBLEVEL);
-			clif_updatestatus(sd, SP_NEXTJOBEXP);
-			clif_updatestatus(sd, SP_JOBEXP);
-			status_calc_pc(sd, 0);
 		}
+		sd->status.job_level = val;
+		sd->status.job_exp = 0;
+		clif_updatestatus(sd, SP_JOBLEVEL);
+		clif_updatestatus(sd, SP_NEXTJOBEXP);
+		clif_updatestatus(sd, SP_JOBEXP);
+		status_calc_pc(sd, 0);
 		clif_updatestatus(sd,type);
 		break;
 	case SP_SKILLPOINT: