fixed again
vending, trade.... git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@301 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
a6379d05f6
commit
fa8e5002f7
@ -1,5 +1,6 @@
|
|||||||
Date Added
|
Date Added
|
||||||
11/21
|
11/21
|
||||||
|
* Re-Fixed Trade/Vending exploit [Lupus]
|
||||||
* Fixed @whozeny. [Valaris]
|
* Fixed @whozeny. [Valaris]
|
||||||
* Added rest of mapflags to const.txt. [Valaris]
|
* Added rest of mapflags to const.txt. [Valaris]
|
||||||
* Closed AFM files after reading, this fixed the improper char-server session #. [Valaris]
|
* Closed AFM files after reading, this fixed the improper char-server session #. [Valaris]
|
||||||
|
@ -96,10 +96,12 @@ void trade_tradeadditem(struct map_session_data *sd, int index, int amount)
|
|||||||
sd->deal_zeny = amount;
|
sd->deal_zeny = amount;
|
||||||
clif_tradeadditem(sd, target_sd, 0, amount);
|
clif_tradeadditem(sd, target_sd, 0, amount);
|
||||||
} else {
|
} else {
|
||||||
|
if (amount != 0) {
|
||||||
trade_tradecancel(sd);
|
trade_tradecancel(sd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (amount > 0 && amount <= sd->status.inventory[index-2].amount) {
|
} else if (amount > 0 && amount <= sd->status.inventory[index-2].amount) {
|
||||||
for(trade_i = 0; trade_i < 10; trade_i++) {
|
for(trade_i = 0; trade_i < 10; trade_i++) {
|
||||||
if (sd->deal_item_amount[trade_i] == 0) {
|
if (sd->deal_item_amount[trade_i] == 0) {
|
||||||
@ -128,7 +130,6 @@ void trade_tradeadditem(struct map_session_data *sd, int index, int amount)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* アイテム追加完了(ok押し)
|
* アイテム追加完了(ok押し)
|
||||||
*------------------------------------------
|
*------------------------------------------
|
||||||
|
@ -65,9 +65,9 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
|
|||||||
for(i = 0, w = z = 0; 8 + 4 * i < len; i++) {
|
for(i = 0, w = z = 0; 8 + 4 * i < len; i++) {
|
||||||
amount = *(short*)(p + 4 * i);
|
amount = *(short*)(p + 4 * i);
|
||||||
index = *(short*)(p + 2 + 4 * i) - 2;
|
index = *(short*)(p + 2 + 4 * i) - 2;
|
||||||
/*
|
|
||||||
if(amount < 0) return; //add
|
if (amount < 0) return; // exploit
|
||||||
for(j=0;j<vsd->vend_num;j++)
|
/* for(j = 0; j < vsd->vend_num; j++)
|
||||||
if (0 < vsd->vending[j].amount && amount <= vsd->vending[j].amount && vsd->vending[j].index == index)
|
if (0 < vsd->vending[j].amount && amount <= vsd->vending[j].amount && vsd->vending[j].index == index)
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
@ -117,14 +117,8 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
|
|||||||
for(i = 0; 8 + 4 * i < len; i++) {
|
for(i = 0; 8 + 4 * i < len; i++) {
|
||||||
amount = *(short*)(p + 4 *i);
|
amount = *(short*)(p + 4 *i);
|
||||||
index = *(short*)(p + 2 + 4 * i) - 2;
|
index = *(short*)(p + 2 + 4 * i) - 2;
|
||||||
if(amount < 0) break; //add
|
//if (amount < 0) break; // tested at start of the function
|
||||||
pc_additem(sd,&vsd->status.cart[index],amount);
|
pc_additem(sd,&vsd->status.cart[index],amount);
|
||||||
|
|
||||||
#ifndef TXT_ONLY
|
|
||||||
if(log_config.vend > 0)
|
|
||||||
log_vend(vsd,sd,index,amount,z);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vsd->vending[vend_list[i]].amount -= amount;
|
vsd->vending[vend_list[i]].amount -= amount;
|
||||||
pc_cart_delitem(vsd, index, amount, 0);
|
pc_cart_delitem(vsd, index, amount, 0);
|
||||||
clif_vendingreport(vsd, index, amount);
|
clif_vendingreport(vsd, index, amount);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user