summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-09 15:50:35 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-09 15:50:35 +0000
commit706900718d474b836d231d4df865b14f738923bc (patch)
tree0e40fc6515568a3dc420dedf598b6db1ba34c464 /src
parent200a55d89a46592729cb8f0116b63e0f7b1c68bb (diff)
downloadhercules-706900718d474b836d231d4df865b14f738923bc.tar.gz
hercules-706900718d474b836d231d4df865b14f738923bc.tar.bz2
hercules-706900718d474b836d231d4df865b14f738923bc.tar.xz
hercules-706900718d474b836d231d4df865b14f738923bc.zip
Added correct extended info packets for items that are being moved into storage or cart.
This caused items to visually lose their properties once they have been moved from inventory (bugreport:250). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12698 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c45
-rw-r--r--src/map/clif.h2
2 files changed, 41 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index cfd87b748..2c2f5c10e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3201,8 +3201,9 @@ int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int i
nullpo_retr(0, sd);
nullpo_retr(0, stor);
-
fd=sd->fd;
+
+#if PACKETVER < 5
WFIFOHEAD(fd,packet_len(0xf4));
WFIFOW(fd,0) =0xf4; // Storage item added
WFIFOW(fd,2) =index+1; // index
@@ -3216,6 +3217,22 @@ int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int i
WFIFOB(fd,12)=stor->storage_[index].refine; //refine
clif_addcards(WFIFOP(fd,13), &stor->storage_[index]);
WFIFOSET(fd,packet_len(0xf4));
+#else
+ WFIFOHEAD(fd,packet_len(0x1c4));
+ WFIFOW(fd,0) =0x1c4; // Storage item added
+ WFIFOW(fd,2) =index+1; // index
+ WFIFOL(fd,4) =amount; // amount
+ if((view = itemdb_viewid(stor->storage_[index].nameid)) > 0)
+ WFIFOW(fd,8) =view;
+ else
+ WFIFOW(fd,8) =stor->storage_[index].nameid; // id
+ WFIFOB(fd,10)=itemdb_type(stor->storage_[index].nameid); //type
+ WFIFOB(fd,11)=stor->storage_[index].identify; //identify flag
+ WFIFOB(fd,12)=stor->storage_[index].attribute; // attribute
+ WFIFOB(fd,13)=stor->storage_[index].refine; //refine
+ clif_addcards(WFIFOP(fd,14), &stor->storage_[index]);
+ WFIFOSET(fd,packet_len(0x1c4));
+#endif
return 0;
}
@@ -4348,8 +4365,7 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
// The following caps negative attributes to 0 since the client displays them as 255-fix. [Skotlex]
// WBUFB(buf,20+i)= (unsigned char)((fix=battle_attr_ratio(i+1,status->def_ele, status->ele_lv))<0?0:fix);
- clif_send(buf,packet_len(0x18c),&sd->bl,
- sd->status.party_id>0?PARTY_SAMEMAP:SELF);
+ clif_send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF);
return 0;
}
/*==========================================
@@ -5002,11 +5018,12 @@ int clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
nullpo_retr(0, sd);
fd=sd->fd;
- WFIFOHEAD(fd,packet_len(0x124));
- buf=WFIFOP(fd,0);
if(n<0 || n>=MAX_CART || sd->status.cart[n].nameid<=0)
return 1;
+#if PACKETVER < 5
+ WFIFOHEAD(fd,packet_len(0x124));
+ buf=WFIFOP(fd,0);
WBUFW(buf,0)=0x124;
WBUFW(buf,2)=n+2;
WBUFL(buf,4)=amount;
@@ -5019,6 +5036,24 @@ int clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
WBUFB(buf,12)=sd->status.cart[n].refine;
clif_addcards(WBUFP(buf,13), &sd->status.cart[n]);
WFIFOSET(fd,packet_len(0x124));
+#else
+ WFIFOHEAD(fd,packet_len(0x1c5));
+ buf=WFIFOP(fd,0);
+ WBUFW(buf,0)=0x1c5;
+ WBUFW(buf,2)=n+2;
+ WBUFL(buf,4)=amount;
+ if((view = itemdb_viewid(sd->status.cart[n].nameid)) > 0)
+ WBUFW(buf,8)=view;
+ else
+ WBUFW(buf,8)=sd->status.cart[n].nameid;
+ WBUFB(buf,10)=itemdb_type(sd->status.cart[n].nameid);
+ WBUFB(buf,11)=sd->status.cart[n].identify;
+ WBUFB(buf,12)=sd->status.cart[n].attribute;
+ WBUFB(buf,13)=sd->status.cart[n].refine;
+ clif_addcards(WBUFP(buf,14), &sd->status.cart[n]);
+ WFIFOSET(fd,packet_len(0x1c5));
+#endif
+
return 0;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index d9672d624..4ce69e4da 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -32,7 +32,7 @@ struct quest;
// 2 - ? - 0x78, 0x79
// 3 - ? - 0x1c8, 0x1c9, 0x1de
// 4 - ? - 0x1d7, 0x1d8, 0x1d9, 0x1da
-// 5 - 2003-12-18aSakexe+ - 0x1ee, 0x1ef, 0x1f0
+// 5 - 2003-12-18aSakexe+ - 0x1ee, 0x1ef, 0x1f0, ?0x1c4, 0x1c5?
// 6 - 2004-03-02aSakexe+ - 0x1f4, 0x1f5
// 7 - 2005-04-11aSakexe+ - 0x229, 0x22a, 0x22b, 0x22c
// 20070521 - 2007-05-21aSakexe+ - 0x283