Bläddra i källkod

- Modified @allstats to prevent negative/overflow issues.
- Fixed HP/SP requirements for WE_MALE/WE_FEMALE
- Fixed a typo in skill.h which fixes a compilation warning.


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

skotlex 19 år sedan
förälder
incheckning
e030ff6086
5 ändrade filer med 15 tillägg och 9 borttagningar
  1. 2 0
      Changelog-Trunk.txt
  2. 2 0
      db/Changelog.txt
  3. 2 2
      db/skill_require_db.txt
  4. 8 6
      src/map/atcommand.c
  5. 1 1
      src/map/skill.h

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 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.
 
+2006/04/06
+	* Modified @allstats to prevent negative/overflow issues. [Skotlex]
 2006/04/05
 	* Fixed undisguising not clearing the mob sprite for the disguised
 	  character. [Skotlex]

+ 2 - 0
db/Changelog.txt

@@ -27,6 +27,8 @@
 
 =========================
 
+04/06
+	* Fixed HP/SP requirements for WE_MALE/WE_FEMALE [Skotlex]
 04/05
 	* Modified the item_db and added view_types to ammo: 1 arrows, 2 dagger
 	  (venom knife), 3 bullets, 4 shells, 5 grenades, 6 shurikens, 7 kunais.

+ 2 - 2
db/skill_require_db.txt

@@ -255,8 +255,8 @@
 329,0,0,43:46:49:52:55:58:61:64:67:70,0,0,0,13:14,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//DC_FORTUNEKISS#�K‰^‚̃LƒX#
 330,0,0,40:45:50:55:60:65:70:75:80:85,0,0,0,13:14,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//DC_SERVICEFORYOU#ƒT?ƒrƒXƒtƒH?ƒ†?#
 
-334,0,0,1,10,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//WE_MALE#ŒN‚¾‚¯‚ÍŒì‚邿#
-335,0,0,1,0,10,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//WE_FEMALE#‚ ‚È‚½‚É?‚­‚µ‚Ü‚·#
+334,0,0,1,-10,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//WE_MALE#ŒN‚¾‚¯‚ÍŒì‚邿#
+335,0,0,1,0,-10,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//WE_FEMALE#‚ ‚È‚½‚É?‚­‚µ‚Ü‚·#
 336,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//WE_CALLPARTNER#‚ ‚È‚½‚Ɉ§‚¢‚½‚¢#
 337,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//ITM_TOMAHAWK##
 

+ 8 - 6
src/map/atcommand.c

@@ -4205,7 +4205,7 @@ int atcommand_stat_all(
 	const int fd, struct map_session_data* sd,
 	const char* command, const char* message)
 {
-	int index, count, value = 0, new_value;
+	int index, count, value = 0, max, new_value;
 	short* status[] = {
 		&sd->status.str,  &sd->status.agi, &sd->status.vit,
 		&sd->status.int_, &sd->status.dex, &sd->status.luk
@@ -4216,14 +4216,16 @@ int atcommand_stat_all(
 		value = pc_maxparameter(sd);
 
 	count = 0;
+	max = pc_maxparameter(sd);
 	for (index = 0; index < (int)(sizeof(status) / sizeof(status[0])); index++) {
 
-		new_value = (int)*status[index] + value;
-		if (value > 0 && (value > pc_maxparameter(sd) || new_value > pc_maxparameter(sd))) // fix positiv overflow
-			new_value = pc_maxparameter(sd);
-		else if (value < 0 && (value < -(int)pc_maxparameter(sd) || new_value < 1)) // fix negative overflow
+		if (value > 0 && *status[index] > max - value)
+			new_value = max;
+		else if (value < 0 && *status[index] <= -value)
 			new_value = 1;
-
+		else
+			new_value = *status[index] +value;
+		
 		if (new_value != (int)*status[index]) {
 			*status[index] = new_value;
 			clif_updatestatus(sd, SP_STR + index);

+ 1 - 1
src/map/skill.h

@@ -165,7 +165,7 @@ int	skill_get_unit_target( int id );
 int	skill_tree_get_max( int id, int b_class );	// Celest
 const char*	skill_get_name( int id ); 	// [Skotlex]
 
-void skill_isammoy_type(TBL_PC *sd, int skill);
+int skill_isammotype(TBL_PC *sd, int skill);
 int skill_castend_id( int tid, unsigned int tick, int id,int data );
 int skill_castend_pos( int tid, unsigned int tick, int id,int data );
 int skill_castend_map( struct map_session_data *sd,int skill_num, const char *map);