Browse Source

Fixed stat values displaying incorrectly when increasing them past 255 (wraparound, ack packet only has 1 byte).
Reordered the packets so that a status update for the increased stat is sent immediately after the buggy ack packet.

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

ultramage 17 years ago
parent
commit
7779074bd2
3 changed files with 8 additions and 5 deletions
  1. 3 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/clif.c
  3. 4 4
      src/map/pc.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
+2008/05/28
+	* Fixed stat values displaying incorrectly when increasing them
+	  past 255 (wraparound, ack packet only has 1 byte) [ultramage]
 2008/05/26
 2008/05/26
 	* Updating configure script: [FlavioJS]
 	* Updating configure script: [FlavioJS]
 	- fixed memory manager using the argument of the last enable/disable option (any option)
 	- fixed memory manager using the argument of the last enable/disable option (any option)

+ 1 - 1
src/map/clif.c

@@ -2612,7 +2612,7 @@ int clif_statusupack(struct map_session_data *sd,int type,int ok,int val)
 	WFIFOW(fd,0)=0xbc;
 	WFIFOW(fd,0)=0xbc;
 	WFIFOW(fd,2)=type;
 	WFIFOW(fd,2)=type;
 	WFIFOB(fd,4)=ok;
 	WFIFOB(fd,4)=ok;
-	WFIFOB(fd,5)=val;
+	WFIFOB(fd,5)=cap_value(val,0,UCHAR_MAX);
 	WFIFOSET(fd,packet_len(0xbc));
 	WFIFOSET(fd,packet_len(0xbc));
 
 
 	return 0;
 	return 0;

+ 4 - 4
src/map/pc.c

@@ -4493,13 +4493,13 @@ int pc_statusup(struct map_session_data *sd,int type)
 	}
 	}
 
 
 	sd->status.status_point-=need;
 	sd->status.status_point-=need;
-	if(need!=pc_need_status_point(sd,type)){
+	status_calc_pc(sd,0);
+
+	if( need != pc_need_status_point(sd,type) )
 		clif_updatestatus(sd,type-SP_STR+SP_USTR);
 		clif_updatestatus(sd,type-SP_STR+SP_USTR);
-	}
 	clif_updatestatus(sd,SP_STATUSPOINT);
 	clif_updatestatus(sd,SP_STATUSPOINT);
-	clif_updatestatus(sd,type);
-	status_calc_pc(sd,0);
 	clif_statusupack(sd,type,1,val);
 	clif_statusupack(sd,type,1,val);
+	clif_updatestatus(sd,type); // send after the 'ack' to override the value
 
 
 	return 0;
 	return 0;
 }
 }