Explorar el Código

another fix

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1280 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber hace 20 años
padre
commit
f8651e0c00
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      Changelog-SVN.txt
  2. 2 2
      src/map/trade.c

+ 1 - 0
Changelog-SVN.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 03/23
+        * Adjusted my trade fix [1280: MouseJstr]
         * Fixed possible memory corruption in storage if number of guilds
           in database exceeds the max server can support [1278 : MouseJstr]
         * Fixed @mapexit to properly flush the fifo's before shutting

+ 2 - 2
src/map/trade.c

@@ -220,8 +220,8 @@ void trade_tradeok(struct map_session_data *sd) {
 
 	// check items
 	for(trade_i = 0; trade_i < 10; trade_i++) {
-		if (((sd->deal_item_index[trade_i]-2) < 0) ||
-		    (sd->deal_item_amount[trade_i] > sd->status.inventory[sd->deal_item_index[trade_i]-2].amount) ||
+		if ((((sd->deal_item_index[trade_i]-2) >= 0) &&
+		    (sd->deal_item_amount[trade_i] > sd->status.inventory[sd->deal_item_index[trade_i]-2].amount)) ||
 		    (sd->deal_item_amount[trade_i] < 0)) {
 			trade_tradecancel(sd);
 			return;