Quellcode durchsuchen

Fixed cash shop not using points to make up the cash difference when purchasing an item.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12853 54d463be-8e91-2dee-dedb-b68131a5f0ec
sketchyphoenix vor 17 Jahren
Ursprung
Commit
159e55e3d1
3 geänderte Dateien mit 7 neuen und 18 gelöschten Zeilen
  1. 2 0
      Changelog-Trunk.txt
  2. 1 3
      src/map/npc.c
  3. 4 15
      src/map/pc.c

+ 2 - 0
Changelog-Trunk.txt

@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2008/06/18
 	* Added a fix for refresh properly displaying dead and sitting players. [SketchyPhoenix]
+	* Fixed basilica behavior not knocking back monsters 2 cells should one attempt to enter the field.
+	* Fixed cash shop not using points to make up the cash difference when purchasing an item.
 2008/06/17
 	* Forgot to commit source modification from r12833 (Updated Novice grounds.) [L0ne_W0lf]
 2008/06/16

+ 1 - 3
src/map/npc.c

@@ -1091,9 +1091,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
 	if( points > price )
 		points = price;
 
-	if( sd->cashPoints < price - points )
-		return 6;
-	if( sd->kafraPoints < points )
+	if( (sd->kafraPoints < points) || (sd->cashPoints < price - points) )
 		return 6;
 
 	pc_paycash(sd, price, points);

+ 4 - 15
src/map/pc.c

@@ -2816,21 +2816,10 @@ void pc_paycash(struct map_session_data *sd, int price, int points)
 	int cash = price - points;
 	nullpo_retv(sd);
 
-	if( cash > 0 )
-	{
-		pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints - cash);
-
-		sprintf(output, "Used %d cash points. %d points remaining.", cash, sd->cashPoints);
-		clif_disp_onlyself(sd, output, strlen(output));
-	}
-
-	if( points > 0 )
-	{
-		pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints - points);
-
-		sprintf(output, "Used %d kafra points. %d points remaining.", points, sd->kafraPoints);
-		clif_disp_onlyself(sd, output, strlen(output));
-	}
+	pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints - cash);
+	pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints - points);
+	sprintf(output, "Used %d kafra points and %d cash points. %d kafra and %d cash points remaining.", points, cash, sd->kafraPoints, sd->cashPoints);
+	clif_disp_onlyself(sd, output, strlen(output));
 }
 
 void pc_getcash(struct map_session_data *sd, int cash, int points)