Browse Source

Fixed @cash/@points not handling negative values properly (bugreport:2132)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13145 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 16 years ago
parent
commit
8fcc1c7432
3 changed files with 6 additions and 4 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/atcommand.c
  3. 2 2
      src/map/charcommand.c

+ 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.
 
+2008/08/28
+	* Fixed @cash/@points not handling negative values properly (bugreport:2132) [ultramage]
 2008/08/26
 	* Fixed @agjgmlvl bug preventing its use on other players. (bugreport:2124) [SketchyPhoenix]
 	* pc_isGM() checks in gm_cant_party config checks will now check against being lower or higher than lowest_gm_level config.

+ 2 - 2
src/map/atcommand.c

@@ -7960,14 +7960,14 @@ int atcommand_cash(const int fd, struct map_session_data* sd, const char* comman
 		if( value > 0 )
 			pc_getcash(sd, value, 0);
 		else
-			pc_paycash(sd, value, 0);
+			pc_paycash(sd, -value, 0);
 	}
 	else
 	{ // @points
 		if( value > 0 )
 			pc_getcash(sd, 0, value);
 		else
-			pc_paycash(sd, value, value);
+			pc_paycash(sd, -value, -value);
 	}
 
 	return 0;

+ 2 - 2
src/map/charcommand.c

@@ -928,7 +928,7 @@ int charcommand_cash(const int fd, struct map_session_data* sd, const char* comm
 			if( value > 0 )
 				pc_getcash(pl_sd, value, 0);
 			else
-				pc_paycash(pl_sd, value, 0);
+				pc_paycash(pl_sd, -value, 0);
 
 			clif_displaymessage(fd, "Character's Cash Points changed!.");
 		}
@@ -937,7 +937,7 @@ int charcommand_cash(const int fd, struct map_session_data* sd, const char* comm
 			if( value > 0 )
 				pc_getcash(pl_sd, 0, value);
 			else
-				pc_paycash(pl_sd, value, value);
+				pc_paycash(pl_sd, -value, -value);
 
 			clif_displaymessage(fd, "Character's Kafra Points changed!.");
 		}