|
@@ -581,15 +581,19 @@ void pc_inventory_rental_add(struct map_session_data *sd, unsigned int seconds)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
-* Check if the player can sell the current item
|
|
|
-* @param sd map_session_data of the player
|
|
|
-* @param item struct of the checking item.
|
|
|
-* @return bool 'true' is sellable, 'false' otherwise
|
|
|
-*/
|
|
|
-bool pc_can_sell_item(struct map_session_data * sd, struct item * item) {
|
|
|
+ * Check if the player can sell the current item
|
|
|
+ * @param sd: map_session_data of the player
|
|
|
+ * @param item: struct of the checking item
|
|
|
+ * @return bool 'true' is sellable, 'false' otherwise
|
|
|
+ */
|
|
|
+bool pc_can_sell_item(struct map_session_data *sd, struct item *item) {
|
|
|
+ struct npc_data *nd;
|
|
|
+
|
|
|
if (sd == NULL || item == NULL)
|
|
|
return false;
|
|
|
|
|
|
+ nd = map_id2nd(sd->npc_shopid);
|
|
|
+
|
|
|
if (!itemdb_cansell(item, pc_get_group_level(sd)))
|
|
|
return false;
|
|
|
|
|
@@ -599,6 +603,9 @@ bool pc_can_sell_item(struct map_session_data * sd, struct item * item) {
|
|
|
if (item->expire_time)
|
|
|
return false; // Cannot Sell Rental Items
|
|
|
|
|
|
+ if (nd && nd->subtype == NPCTYPE_ITEMSHOP && item->bound && battle_config.allow_bound_sell)
|
|
|
+ return true; // NPCTYPE_ITEMSHOP and bound item config is sellable
|
|
|
+
|
|
|
if (item->bound && !pc_can_give_bounded_items(sd))
|
|
|
return false; // Don't allow sale of bound items
|
|
|
return true;
|