Browse Source

Fixed pc_addfame logic (#8912)

It added to the fame points before checking the class.
Additionally it allowed to go below zero.
Lemongrass3110 4 months ago
parent
commit
43a1b127c0
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/map/pc.cpp

+ 2 - 4
src/map/pc.cpp

@@ -1010,10 +1010,6 @@ bool pc_addfame(map_session_data &sd, int32 count)
 {
 	enum e_rank ranktype;
 
-	sd.status.fame += count;
-	if (sd.status.fame > MAX_FAME)
-		sd.status.fame = MAX_FAME;
-
 	switch(sd.class_&MAPID_UPPERMASK){
 		case MAPID_BLACKSMITH:	ranktype = RANK_BLACKSMITH; break;
 		case MAPID_ALCHEMIST:	ranktype = RANK_ALCHEMIST; break;
@@ -1023,6 +1019,8 @@ bool pc_addfame(map_session_data &sd, int32 count)
 			return false;
 	}
 
+	sd.status.fame = cap_value( sd.status.fame + count, 0, MAX_FAME );
+
 	clif_update_rankingpoint(sd, ranktype, count);
 	chrif_updatefamelist(sd, ranktype);
 	return true;