|
@@ -4548,7 +4548,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
|
|
if( i < MAX_CART )
|
|
if( i < MAX_CART )
|
|
{// item already in cart, stack it
|
|
{// item already in cart, stack it
|
|
if( amount > MAX_AMOUNT - sd->status.cart[i].amount || ( data->stack.cart && amount > data->stack.amount - sd->status.cart[i].amount ) )
|
|
if( amount > MAX_AMOUNT - sd->status.cart[i].amount || ( data->stack.cart && amount > data->stack.amount - sd->status.cart[i].amount ) )
|
|
- return 1; // no room
|
|
|
|
|
|
+ return 2; // no slot
|
|
|
|
|
|
sd->status.cart[i].amount+=amount;
|
|
sd->status.cart[i].amount+=amount;
|
|
clif_cart_additem(sd,i,amount,0);
|
|
clif_cart_additem(sd,i,amount,0);
|
|
@@ -4557,7 +4557,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
|
|
{// item not stackable or not present, add it
|
|
{// item not stackable or not present, add it
|
|
ARR_FIND( 0, MAX_CART, i, sd->status.cart[i].nameid == 0 );
|
|
ARR_FIND( 0, MAX_CART, i, sd->status.cart[i].nameid == 0 );
|
|
if( i == MAX_CART )
|
|
if( i == MAX_CART )
|
|
- return 1; // no room
|
|
|
|
|
|
+ return 2; // no slot
|
|
|
|
|
|
memcpy(&sd->status.cart[i],item_data,sizeof(sd->status.cart[0]));
|
|
memcpy(&sd->status.cart[i],item_data,sizeof(sd->status.cart[0]));
|
|
sd->status.cart[i].amount=amount;
|
|
sd->status.cart[i].amount=amount;
|
|
@@ -4612,6 +4612,7 @@ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_
|
|
int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
|
|
int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
|
|
{
|
|
{
|
|
struct item *item_data;
|
|
struct item *item_data;
|
|
|
|
+ short flag;
|
|
|
|
|
|
nullpo_ret(sd);
|
|
nullpo_ret(sd);
|
|
|
|
|
|
@@ -4623,10 +4624,10 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
|
|
if( item_data->nameid == 0 || amount < 1 || item_data->amount < amount || sd->state.vending )
|
|
if( item_data->nameid == 0 || amount < 1 || item_data->amount < amount || sd->state.vending )
|
|
return 1;
|
|
return 1;
|
|
|
|
|
|
- if( pc_cart_additem(sd,item_data,amount,LOG_TYPE_NONE) == 0 )
|
|
|
|
|
|
+ if( (flag = pc_cart_additem(sd,item_data,amount,LOG_TYPE_NONE)) == 0 )
|
|
return pc_delitem(sd,idx,amount,0,5,LOG_TYPE_NONE);
|
|
return pc_delitem(sd,idx,amount,0,5,LOG_TYPE_NONE);
|
|
|
|
|
|
- return 1;
|
|
|
|
|
|
+ return flag;
|
|
}
|
|
}
|
|
|
|
|
|
/*==========================================
|
|
/*==========================================
|