Fixed random options being removed on cardremoval

Fixes #1587
This commit is contained in:
Lemongrass3110 2016-10-03 13:31:20 +02:00
parent 6510d414fa
commit 5a5621073f

View File

@ -12645,6 +12645,12 @@ BUILDIN_FUNC(successremovecards) {
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
for (j = 0; j < MAX_ITEM_RDM_OPT; j++){
item_tmp.option[j].id=sd->status.inventory[i].option[j].id;
item_tmp.option[j].value=sd->status.inventory[i].option[j].value;
item_tmp.option[j].param=sd->status.inventory[i].option[j].param;
}
pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ //chk if can be spawn in inventory otherwise put on floor
@ -12703,8 +12709,7 @@ BUILDIN_FUNC(failedremovecards) {
if(cardflag == 1) {
if(typefail == 0 || typefail == 2){ // destroy the item
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
}
if(typefail == 1){ // destroy the card
}else if(typefail == 1){ // destroy the card
unsigned char flag = 0, j;
struct item item_tmp;
@ -12719,6 +12724,12 @@ BUILDIN_FUNC(failedremovecards) {
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory[i].card[j];
for (j = 0; j < MAX_ITEM_RDM_OPT; j++){
item_tmp.option[j].id=sd->status.inventory[i].option[j].id;
item_tmp.option[j].value=sd->status.inventory[i].option[j].value;
item_tmp.option[j].param=sd->status.inventory[i].option[j].param;
}
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);