- Should have fixed clif_item_sub to properly store pet egg/armor data. There should be no more "random refine levels" bugs related to these.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7574 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-07-07 19:30:53 +00:00
parent 41e3ff9044
commit f0d7d12d88
2 changed files with 13 additions and 10 deletions

View File

@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/07/07
* Should have fixed clif_item_sub to properly store pet egg/armor data.
There should be no more "random refine levels" bugs related to these.
[Skotlex]
* itemdb_exists will now return NULL for item_id 0. [Skotlex]
* Added a check to free a character from memory when changing map servers.
[Skotlex]

View File

@ -2214,8 +2214,8 @@ int clif_delitem(struct map_session_data *sd,int n,int amount)
}
// Simplifies inventory/cart/storage packets by handling the packet section relevant to items. [Skotlex]
// Equip is > 0 for equippable items (holds the equip-point)
// 0 for stackable items, -1 for stackable items where arrows must send in the equip-point.
// Equip is >= 0 for equippable items (holds the equip-point, is 0 for pet
// armor/egg) -1 for stackable items, -2 for stackable items where arrows must send in the equip-point.
void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip)
{
if (id->view_id > 0)
@ -2224,15 +2224,15 @@ void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *
WBUFW(buf,n)=i->nameid;
WBUFB(buf,n+2)=itemtype(id->type);
WBUFB(buf,n+3)=i->identify;
if (equip > 0 || id->type == 7) { //Equippable item (pet eggs also count).
if (equip >= 0) { //Equippable item
WBUFW(buf,n+4)=equip;
WBUFW(buf,n+6)=i->equip;
WBUFB(buf,n+8)=i->attribute;
WBUFB(buf,n+9)=i->refine;
} else { //Stackable item.
WBUFW(buf,n+4)=i->amount;
if (equip == -1 && id->equip == 0x8000)
WBUFW(buf,n+6)=0x8000;
if (equip == -2 && id->equip == EQP_AMMO)
WBUFW(buf,n+6)=EQP_AMMO;
else
WBUFW(buf,n+6)=0;
}
@ -2265,8 +2265,8 @@ void clif_inventorylist(struct map_session_data *sd)
ne++;
} else { //Stackable.
WBUFW(buf,n*s+4)=i+2;
clif_item_sub(buf, n*s+6, &sd->status.inventory[i], sd->inventory_data[i], -1);
if (sd->inventory_data[i]->equip == 0x8000 &&
clif_item_sub(buf, n*s+6, &sd->status.inventory[i], sd->inventory_data[i], -2);
if (sd->inventory_data[i]->equip == EQP_AMMO &&
sd->status.inventory[i].equip)
arrow=i;
#if PACKETVER >= 5
@ -2349,7 +2349,7 @@ void clif_storagelist(struct map_session_data *sd,struct storage *stor)
ne++;
} else { //Stackable
WBUFW(buf,n*s+4)=i+1;
clif_item_sub(buf, n*s+6, &stor->storage_[i], id, 0);
clif_item_sub(buf, n*s+6, &stor->storage_[i], id,-1);
#if PACKETVER >= 5
clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]);
#endif
@ -2399,7 +2399,7 @@ void clif_guildstoragelist(struct map_session_data *sd,struct guild_storage *sto
ne++;
} else { //Stackable
WBUFW(buf,n*s+4)=i+1;
clif_item_sub(buf, n*s+6, &stor->storage_[i], id, 0);
clif_item_sub(buf, n*s+6, &stor->storage_[i], id,-1);
#if PACKETVER >= 5
clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]);
#endif
@ -2448,7 +2448,7 @@ void clif_cartlist(struct map_session_data *sd)
ne++;
} else { //Stackable
WBUFW(buf,n*s+4)=i+2;
clif_item_sub(buf, n*s+6, &sd->status.cart[i], id, 0);
clif_item_sub(buf, n*s+6, &sd->status.cart[i], id,-1);
#if PACKETVER >= 5
clif_addcards(WBUFP(buf,n*s+14), &sd->status.cart[i]);
#endif