Ver Fonte

int is too much for 'i' that limited to MAX_SKILL_LEVEL 100. :P

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh há 11 anos atrás
pai
commit
98f7a78133
2 ficheiros alterados com 13 adições e 17 exclusões
  1. 11 15
      src/map/pc.c
  2. 2 2
      src/map/pc.h

+ 11 - 15
src/map/pc.c

@@ -184,13 +184,13 @@ static int pc_spiritball_timer(int tid, unsigned int tick, int id, intptr_t data
 * @param sd
 * @param interval
 * @param max
-* @return 0
 */
-int pc_addspiritball(struct map_session_data *sd,int interval,int max)
+void pc_addspiritball(struct map_session_data *sd,int interval,int max)
 {
-	int tid, i;
+	int tid;
+	uint8 i;
 
-	nullpo_ret(sd);
+	nullpo_retv(sd);
 
 	if(max > MAX_SKILL_LEVEL)
 		max = MAX_SKILL_LEVEL;
@@ -217,30 +217,27 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max)
 		clif_millenniumshield(sd,sd->spiritball);
 	else
 		clif_spiritball(&sd->bl);
-
-	return 0;
 }
 
 /**
 * Removes number of spiritball from player
 * @param sd
 * @param count
-* @param type 0 = gives client effect
-* @return 0
+* @param type 1 = doesn't give client effect
 */
-int pc_delspiritball(struct map_session_data *sd,int count,int type)
+void pc_delspiritball(struct map_session_data *sd,int count,int type)
 {
-	int i;
+	uint8 i;
 
-	nullpo_ret(sd);
+	nullpo_retv(sd);
 
 	if(sd->spiritball <= 0) {
 		sd->spiritball = 0;
-		return 0;
+		return;
 	}
 
-	if(count <= 0)
-		return 0;
+	if(count == 0)
+		return;
 	if(count > sd->spiritball)
 		count = sd->spiritball;
 	sd->spiritball -= count;
@@ -264,7 +261,6 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type)
 		else
 			clif_spiritball(&sd->bl);
 	}
-	return 0;
 }
 
 static int pc_check_banding( struct block_list *bl, va_list ap ) {

+ 2 - 2
src/map/pc.h

@@ -1016,8 +1016,8 @@ extern const struct sg_data sg_info[MAX_PC_FEELHATE];
 void pc_setinvincibletimer(struct map_session_data* sd, int val);
 void pc_delinvincibletimer(struct map_session_data* sd);
 
-int pc_addspiritball(struct map_session_data *sd,int interval,int max);
-int pc_delspiritball(struct map_session_data *sd,int count,int type);
+void pc_addspiritball(struct map_session_data *sd,int interval,int max);
+void pc_delspiritball(struct map_session_data *sd,int count,int type);
 void pc_addfame(struct map_session_data *sd,int count);
 unsigned char pc_famerank(int char_id, int job);
 bool pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl);