diff options
Diffstat (limited to 'src/map/vending.c')
-rw-r--r-- | src/map/vending.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/vending.c b/src/map/vending.c index 723cb014f..0f8255788 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -59,7 +59,7 @@ void vending_vendinglistreq(struct map_session_data* sd, int id) { // GM is not allowed to trade clif_displaymessage(sd->fd, msg_txt(246)); return; - } + } sd->vended_id = vsd->vender_id; // register vending uid @@ -139,11 +139,11 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui clif_buyvending(sd, idx, amount, 2); // you can not buy, because overweight return; } - + //Check to see if cart/vend info is in sync. if( vending[j].amount > vsd->status.cart[idx].amount ) vending[j].amount = vsd->status.cart[idx].amount; - + // if they try to add packets (example: get twice or more 2 apples if marchand has only 3 apples). // here, we check cumulative amounts if( vending[j].amount < amount ) @@ -152,7 +152,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity return; } - + vending[j].amount -= amount; switch( pc_checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) { @@ -199,7 +199,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui { if( vsd->vending[i].amount == 0 ) continue; - + if( cursor != i ) // speedup { vsd->vending[cursor].index = vsd->vending[i].index; @@ -233,18 +233,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui } static int vending_checknearnpc_sub(struct block_list* bl, va_list args) { struct npc_data *nd = (struct npc_data*)bl; - + if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) ) return 0; return 1; } bool vending_checknearnpc(struct block_list * bl) { - + if( battle_config.min_npc_vending_distance > 0 && map_foreachinrange(vending_checknearnpc_sub,bl, battle_config.min_npc_vending_distance, BL_NPC) ) return true; - + return false; } /*========================================== @@ -284,8 +284,8 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } - - + + // filter out invalid items i = 0; for( j = 0; j < count; j++ ) |