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 5b0bfdaa5..e0dd844e1 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -51,7 +51,7 @@ void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) { if( !vsd->state.vending ) return; // not vending - if (!iPc->can_give_items(sd) || !iPc->can_give_items(vsd)) { //check if both GMs are allowed to trade + if (!pc->can_give_items(sd) || !pc->can_give_items(vsd)) { //check if both GMs are allowed to trade // GM is not allowed to trade clif->message(sd->fd, msg_txt(246)); return; @@ -88,7 +88,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, if( count < 1 || count > MAX_VENDING || count > vsd->vend_num ) return; // invalid amount of purchased items - blank = iPc->inventoryblank(sd); //number of free cells in the buyer's inventory + blank = pc->inventoryblank(sd); //number of free cells in the buyer's inventory // duplicate item in vending to check hacker with multiple packets memcpy(&vend, &vsd->vending, sizeof(vsd->vending)); // copy vending list @@ -144,7 +144,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, vend[j].amount -= amount; - switch( iPc->checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) { + switch( pc->checkadditem(sd, vsd->status.cart[idx].nameid, amount) ) { case ADDITEM_EXIST: break; //We'd add this item to the existing one (in buyers inventory) case ADDITEM_NEW: @@ -157,10 +157,10 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, } } - iPc->payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd); + pc->payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd); if( battle_config.vending_tax ) z -= z * (battle_config.vending_tax/10000.); - iPc->getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd); + pc->getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd); for( i = 0; i < count; i++ ) { short amount = *(uint16*)(data + 4*i + 0); @@ -168,9 +168,9 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, idx -= 2; // vending item - iPc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING); + pc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING); vsd->vending[vend_list[i]].amount -= amount; - iPc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING); + pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING); clif->vendingreport(vsd, idx, amount); //print buyer's name @@ -226,7 +226,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const if ( pc_isdead(sd) || !sd->state.prevend || pc_istrading(sd)) return; // can't open vendings lying dead || didn't use via the skill (wpe/hack) || can't have 2 shops at once - vending_skill_lvl = iPc->checkskill(sd, MC_VENDING); + vending_skill_lvl = pc->checkskill(sd, MC_VENDING); // skill level and cart check if( !vending_skill_lvl || !pc_iscarton(sd) ) { clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); @@ -250,12 +250,12 @@ void vending_openvending(struct map_session_data* sd, const char* message, const index -= 2; // offset adjustment (client says that the first cart position is 2) if( index < 0 || index >= MAX_CART // invalid position - || iPc->cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity + || pc->cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity //NOTE: official server does not do any of the following checks! || !sd->status.cart[index].identify // unidentified item || sd->status.cart[index].attribute == 1 // broken item || sd->status.cart[index].expire_time // It should not be in the cart but just in case - || !itemdb_cantrade(&sd->status.cart[index], iPc->get_group_level(sd), iPc->get_group_level(sd)) ) // untradeable item + || !itemdb_cantrade(&sd->status.cart[index], pc->get_group_level(sd), pc->get_group_level(sd)) ) // untradeable item continue; sd->vending[i].index = index; |