Update Item Card slot count (#6301)
Should cover all card slots since these slots doesn't only store card anymore.
This commit is contained in:
parent
5193fd6c92
commit
00be4ee9ca
@ -4059,7 +4059,7 @@ The renewal feature to check is determined by the number <type>.
|
|||||||
*isequipped(<id>{,<id>{,..}})
|
*isequipped(<id>{,<id>{,..}})
|
||||||
|
|
||||||
This function will return 1 if the invoking character has all of the item
|
This function will return 1 if the invoking character has all of the item
|
||||||
IDs given equipped (if card IDs are passed, then it checks if the cards are
|
IDs given equipped (if item/card IDs are passed, then it checks if the items/cards are
|
||||||
inserted into slots in the equipment they are currently wearing). Theoretically
|
inserted into slots in the equipment they are currently wearing). Theoretically
|
||||||
there is no limit to the number of items that may be tested for at the same time.
|
there is no limit to the number of items that may be tested for at the same time.
|
||||||
If even one of the items given is not equipped, 0 will be returned.
|
If even one of the items given is not equipped, 0 will be returned.
|
||||||
@ -4085,9 +4085,9 @@ Example:
|
|||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
*checkequipedcard(<card id>)
|
*checkequipedcard(<item id>)
|
||||||
|
|
||||||
This function will return 1 if the card specified by its item ID number is
|
This function will return 1 if the item/card specified by its item ID number is
|
||||||
inserted into any equipment they have in their inventory, currently equipped or
|
inserted into any equipment they have in their inventory, currently equipped or
|
||||||
not.
|
not.
|
||||||
|
|
||||||
|
@ -1295,7 +1295,7 @@ bool pc_isequipped(struct map_session_data *sd, t_itemid nameid)
|
|||||||
continue;
|
continue;
|
||||||
if( sd->inventory_data[index]->nameid == nameid )
|
if( sd->inventory_data[index]->nameid == nameid )
|
||||||
return true;
|
return true;
|
||||||
for( j = 0; j < sd->inventory_data[index]->slots; j++ ){
|
for( j = 0; j < MAX_SLOTS; j++ ){
|
||||||
if( sd->inventory.u.items_inventory[index].card[j] == nameid )
|
if( sd->inventory.u.items_inventory[index].card[j] == nameid )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -15516,7 +15516,7 @@ BUILDIN_FUNC(checkequipedcard)
|
|||||||
if(sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].amount && sd->inventory_data[i]){
|
if(sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].amount && sd->inventory_data[i]){
|
||||||
if (itemdb_isspecial(sd->inventory.u.items_inventory[i].card[0]))
|
if (itemdb_isspecial(sd->inventory.u.items_inventory[i].card[0]))
|
||||||
continue;
|
continue;
|
||||||
for(n=0;n<sd->inventory_data[i]->slots;n++){
|
for (n=0; n < MAX_SLOTS; n++) {
|
||||||
if(sd->inventory.u.items_inventory[i].card[n] == c) {
|
if(sd->inventory.u.items_inventory[i].card[n] == c) {
|
||||||
script_pushint(st,1);
|
script_pushint(st,1);
|
||||||
return SCRIPT_CMD_SUCCESS;
|
return SCRIPT_CMD_SUCCESS;
|
||||||
@ -16068,7 +16068,7 @@ BUILDIN_FUNC(isequippedcnt)
|
|||||||
} else { //Count cards.
|
} else { //Count cards.
|
||||||
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
||||||
continue; //No cards
|
continue; //No cards
|
||||||
for (short k = 0; k < sd->inventory_data[index]->slots; k++) {
|
for (short k = 0; k < MAX_SLOTS; k++) {
|
||||||
if (sd->inventory.u.items_inventory[index].card[k] == id)
|
if (sd->inventory.u.items_inventory[index].card[k] == id)
|
||||||
ret++; //[Lupus]
|
ret++; //[Lupus]
|
||||||
}
|
}
|
||||||
@ -16124,11 +16124,10 @@ BUILDIN_FUNC(isequipped)
|
|||||||
break;
|
break;
|
||||||
} else { //Cards
|
} else { //Cards
|
||||||
short k;
|
short k;
|
||||||
if (sd->inventory_data[index]->slots == 0 ||
|
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
||||||
itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (k = 0; k < sd->inventory_data[index]->slots; k++)
|
for (k = 0; k < MAX_SLOTS; k++)
|
||||||
{ //New hash system which should support up to 4 slots on any equipment. [Skotlex]
|
{ //New hash system which should support up to 4 slots on any equipment. [Skotlex]
|
||||||
unsigned int hash = 0;
|
unsigned int hash = 0;
|
||||||
if (sd->inventory.u.items_inventory[index].card[k] != id)
|
if (sd->inventory.u.items_inventory[index].card[k] != id)
|
||||||
@ -16198,7 +16197,7 @@ BUILDIN_FUNC(cardscnt)
|
|||||||
} else {
|
} else {
|
||||||
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
|
||||||
continue;
|
continue;
|
||||||
for(k=0; k<sd->inventory_data[index]->slots; k++) {
|
for (k=0; k < MAX_SLOTS; k++) {
|
||||||
if (sd->inventory.u.items_inventory[index].card[k] == id)
|
if (sd->inventory.u.items_inventory[index].card[k] == id)
|
||||||
ret++;
|
ret++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user