summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-06 02:46:17 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:18 +0300
commit62e26cfe0e2e710bc469036ffb9c2b8bb0e3d225 (patch)
tree58e1429fee4eeb114e9bd13f3602b19e7bb161a9 /src
parent6900b9087b83da2aa5a4ab62e8618499f7f4835f (diff)
downloadhercules-62e26cfe0e2e710bc469036ffb9c2b8bb0e3d225.tar.gz
hercules-62e26cfe0e2e710bc469036ffb9c2b8bb0e3d225.tar.bz2
hercules-62e26cfe0e2e710bc469036ffb9c2b8bb0e3d225.tar.xz
hercules-62e26cfe0e2e710bc469036ffb9c2b8bb0e3d225.zip
Update packet ZC_SPRITE_CHANGE.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c22
-rw-r--r--src/map/packets_struct.h20
2 files changed, 28 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 89164657d..6cc8a4977 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3476,21 +3476,15 @@ static void clif_changetraplook(struct block_list *bl, int val)
/// 01d7 <id>.L <type>.B <value>.L (ZC_SPRITE_CHANGE2)
static void clif_sendlook(struct block_list *bl, int id, int type, int val, int val2, enum send_target target)
{
- unsigned char buf[32];
-#if PACKETVER < 4
- WBUFW(buf,0)=0xc3;
- WBUFL(buf,2)=id;
- WBUFB(buf,6)=type;
- WBUFB(buf,7)=val;
- clif->send(buf,packet_len(0xc3),bl,target);
-#else
- WBUFW(buf,0)=0x1d7;
- WBUFL(buf,2)=id;
- WBUFB(buf,6)=type;
- WBUFW(buf,7)=val;
- WBUFW(buf,9)=val2;
- clif->send(buf,packet_len(0x1d7),bl,target);
+ struct PACKET_ZC_SPRITE_CHANGE p;
+ p.packetType = sendLookType;
+ p.AID = id;
+ p.type = type;
+ p.val = val;
+#if PACKETVER >= 4
+ p.val2 = val2;
#endif
+ clif->send(&p, sizeof(p), bl, target);
}
//For the stupid cloth-dye bug. Resends the given view data to the area specified by bl.
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index b8abe0b23..d962795ab 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -385,6 +385,11 @@ enum packet_headers {
#else
useItemAckType = 0xa8,
#endif
+#if PACKETVER >= 4
+ sendLookType = 0x1d7,
+#else
+ sendLookType = 0xc3,
+#endif
};
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
@@ -1962,6 +1967,21 @@ struct PACKET_ZC_USE_ITEM_ACK {
uint8 result;
} __attribute__((packed));
+struct PACKET_ZC_SPRITE_CHANGE {
+ int16 packetType;
+ uint32 AID;
+ uint8 type;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 val;
+ uint32 val2;
+#elif PACKETVER >= 4
+ uint16 val;
+ uint16 val2;
+#else
+ uint8 val;
+#endif
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris