temporary fix for vending items not saving correct cart ID > prompt player to relog if we have a new item in cart
This commit is contained in:
parent
eba153919e
commit
a5b2b4ed49
@ -4604,6 +4604,9 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
|
|||||||
if( (w = data->weight*amount) + sd->cart_weight > sd->cart_weight_max )
|
if( (w = data->weight*amount) + sd->cart_weight > sd->cart_weight_max )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
//id no longer points to inventory/kafra id, while we get a new one, we don't want to mess up vending creation
|
||||||
|
item_data->id = 0;
|
||||||
|
|
||||||
i = MAX_CART;
|
i = MAX_CART;
|
||||||
if( itemdb_isstackable2(data) && !item_data->expire_time )
|
if( itemdb_isstackable2(data) && !item_data->expire_time )
|
||||||
{
|
{
|
||||||
|
8
src/map/vending.c
Normal file → Executable file
8
src/map/vending.c
Normal file → Executable file
@ -345,6 +345,14 @@ bool vending_openvending(struct map_session_data* sd, const char* message, const
|
|||||||
sd->vending[i].amount = amount;
|
sd->vending[i].amount = amount;
|
||||||
sd->vending[i].value = min(value, (unsigned int)battle_config.vending_max_value);
|
sd->vending[i].value = min(value, (unsigned int)battle_config.vending_max_value);
|
||||||
|
|
||||||
|
//player just moved item to cart and we don't have the correct cart ID yet
|
||||||
|
if (sd->status.cart[sd->vending[i].index].id == 0) {
|
||||||
|
snprintf(msg, 256, "Item %s is not yet saved. Please re-log in order to correctly save your vending.", idb->jname);
|
||||||
|
clif_displaymessage(sd->fd, msg);
|
||||||
|
clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
i++; // item successfully added
|
i++; // item successfully added
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user