Pārlūkot izejas kodu

Found an issue with pc_jobchange.
Not a problem if you use the standard job changing actions, but if you switch jobs via @job command.

Might be related to bugreport:7388

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17208 54d463be-8e91-2dee-dedb-b68131a5f0ec

lemongrass3110 12 gadi atpakaļ
vecāks
revīzija
b30258ea45
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. 13 0
      src/map/pc.c

+ 13 - 0
src/map/pc.c

@@ -7384,6 +7384,19 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
 		pc_setglobalreg(sd, "REPRODUCE_SKILL_LV",0);
 	}
 
+	// Give or reduce transcendent status points
+	if( (b_class&JOBL_UPPER) && !(sd->class_&JOBL_UPPER) ){ // Change from a non t class to a t class -> give points
+		sd->status.status_point += 52;
+		clif_updatestatus(sd,SP_STATUSPOINT);
+	}else if( !(b_class&JOBL_UPPER) && (sd->class_&JOBL_UPPER) ){ // Change from a t class to a non t class -> remove points
+		if( sd->status.status_point < 52 ){
+			// The player already used his bonus points, so we have to reset his status points
+			pc_resetstate(sd);
+		}
+		sd->status.status_point -= 52;
+		clif_updatestatus(sd,SP_STATUSPOINT);
+	}
+
 	if ( (b_class&MAPID_UPPERMASK) != (sd->class_&MAPID_UPPERMASK) ) { //Things to remove when changing class tree.
 		const int class_ = pc_class2idx(sd->status.class_);
 		short id;