Ver código fonte

- fixed pc_statusup2(): status cost update condition

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16701 54d463be-8e91-2dee-dedb-b68131a5f0ec
salepate 12 anos atrás
pai
commit
ef3fd2202a
1 arquivos alterados com 2 adições e 4 exclusões
  1. 2 4
      src/map/pc.c

+ 2 - 4
src/map/pc.c

@@ -5824,7 +5824,7 @@ int pc_statusup(struct map_session_data* sd, int type)
 /// @param val The stat increase amount.
 int pc_statusup2(struct map_session_data* sd, int type, int val)
 {
-	int max, need;
+	int max;
 	nullpo_ret(sd);
 
 	if( type < SP_STR || type > SP_LUK )
@@ -5833,8 +5833,6 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
 		return 1;
 	}
 
-	need = pc_need_status_point(sd,type,1);
-
 	// set new value
 	max = pc_maxparameter(sd);
 	val = pc_setstat(sd, type, cap_value(pc_getstat(sd,type) + val, 1, max));
@@ -5842,7 +5840,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
 	status_calc_pc(sd,0);
 
 	// update increase cost indicator
-	if( need != pc_need_status_point(sd,type,1) )
+	if( pc_need_status_point(sd, type, val) != pc_need_status_point(sd,type,1) )
 		clif_updatestatus(sd, SP_USTR + type-SP_STR);
 
 	// update stat value