summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-07 09:10:40 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:21 +0300
commit9242b8169932bf52b409be4d33aa0f3cfb08f347 (patch)
tree6f78a315fd6760b54fae7d8dad73de6ed848e140
parentdd05ed32606dd2ecf1175ac9404c00615b33491f (diff)
downloadhercules-9242b8169932bf52b409be4d33aa0f3cfb08f347.tar.gz
hercules-9242b8169932bf52b409be4d33aa0f3cfb08f347.tar.bz2
hercules-9242b8169932bf52b409be4d33aa0f3cfb08f347.tar.xz
hercules-9242b8169932bf52b409be4d33aa0f3cfb08f347.zip
Update packet ZC_ADD_ITEM_TO_MAIL.
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/clif.h3
-rw-r--r--src/map/packets_struct.h9
3 files changed, 14 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 76d8f751d..9e6e0f779 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -20194,7 +20194,7 @@ static void clif_parse_rodex_add_item(int fd, struct map_session_data *sd)
rodex->add_item(sd, idx, (int16)rPacket->count);
}
-static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, int16 amount, int8 result)
+static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, int16 amount, enum rodex_add_item result)
{
#if PACKETVER >= 20141119
struct PACKET_ZC_ADD_ITEM_TO_MAIL *packet;
@@ -20202,7 +20202,7 @@ static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, i
nullpo_retv(sd);
if (idx < 0 || idx >= MAX_INVENTORY)
- result = RODEX_ADD_ITEM_FATAL_ERROR;
+ return;
fd = sd->fd;
@@ -20219,7 +20219,7 @@ static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, i
packet->index = idx + 2;
packet->count = amount;
- packet->ITID = sd->status.inventory[idx].nameid;
+ packet->itemId = sd->status.inventory[idx].nameid;
packet->type = itemtype(sd->inventory_data[idx]->type);
packet->IsIdentified = sd->status.inventory[idx].identify ? 1 : 0;
packet->IsDamaged = (sd->status.inventory[idx].attribute & ATTR_BROKEN) != 0 ? 1 : 0;
@@ -20232,6 +20232,8 @@ static void clif_rodex_add_item_result(struct map_session_data *sd, int16 idx, i
packet->optionData[j].value = sd->status.inventory[idx].option[j].value;
}
packet->weight = sd->rodex.tmp.weight / 10;
+ packet->favorite = sd->status.inventory[idx].favorite;
+ packet->location = pc->equippoint(sd, idx);
WFIFOSET(fd, sizeof(*packet));
#endif
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 149533ab9..92db684bd 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -56,6 +56,7 @@ struct unit_data;
struct view_data;
enum clif_messages;
+enum rodex_add_item;
/**
* Defines
@@ -1444,7 +1445,7 @@ struct clif_interface {
void (*pRodexOpenWriteMail) (int fd, struct map_session_data *sd);
void (*rodex_open_write_mail) (int fd, const char *receiver_name, int8 result);
void (*pRodexAddItem) (int fd, struct map_session_data *sd);
- void (*rodex_add_item_result) (struct map_session_data *sd, int16 idx, int16 amount, int8 result);
+ void (*rodex_add_item_result) (struct map_session_data *sd, int16 idx, int16 amount, enum rodex_add_item result);
void (*pRodexRemoveItem) (int fd, struct map_session_data *sd);
void (*rodex_remove_item_result) (struct map_session_data *sd, int16 idx, int16 amount);
void (*pRodexSendMail) (int fd, struct map_session_data *sd);
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 2ba537ef8..177aaf668 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -1393,7 +1393,11 @@ struct PACKET_ZC_ADD_ITEM_TO_MAIL {
int8 result;
int16 index;
int16 count;
- uint16 ITID;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 itemId;
+#else
+ uint16 itemId;
+#endif
int8 type;
int8 IsIdentified;
int8 IsDamaged;
@@ -1401,7 +1405,8 @@ struct PACKET_ZC_ADD_ITEM_TO_MAIL {
struct EQUIPSLOTINFO slot;
struct ItemOptions optionData[MAX_ITEM_OPTIONS];
int16 weight;
- int8 unknow[5];
+ uint8 favorite;
+ uint32 location;
} __attribute__((packed));
struct mail_item {