summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-10-04 22:50:36 +0200
committerHaru <haru@dotalux.com>2015-10-04 22:50:36 +0200
commitacbbba21c888c7e8c9a6c31652dfd61c90ca6ac8 (patch)
tree3758e0d16b4090f31271682f86133f34598cee97 /src/map/atcommand.c
parent4db986b93566d673c226971fa045f1dc99645242 (diff)
downloadhercules-acbbba21c888c7e8c9a6c31652dfd61c90ca6ac8.tar.gz
hercules-acbbba21c888c7e8c9a6c31652dfd61c90ca6ac8.tar.bz2
hercules-acbbba21c888c7e8c9a6c31652dfd61c90ca6ac8.tar.xz
hercules-acbbba21c888c7e8c9a6c31652dfd61c90ca6ac8.zip
Added clif->packet() to retrieve info about a packet.
- As per Malufett/Michieru request, in order to make it possible for a plugin to obtain information about a packet. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 37f50dc5e..15422a74a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -242,16 +242,16 @@ ACMD(send)
}\
} while(0) //define GET_VALUE
- if (type > 0 && type < MAX_PACKET_DB) {
+ if (type >= MIN_PACKET_DB && type <= MAX_PACKET_DB) {
int off = 2;
if (len) {
// show packet length
- safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, packet_db[type].len); // Packet 0x%x length: %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, clif->packet(type)->len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
return true;
}
- len=packet_db[type].len;
+ len = clif->packet(type)->len;
if (len == 0) {
// unknown packet - ERROR
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,905), type); // Unknown packet: 0x%x
@@ -402,7 +402,7 @@ ACMD(send)
SKIP_VALUE(message);
}
- if(packet_db[type].len == -1) {// send dynamic packet
+ if (clif->packet(type)->len == -1) { // send dynamic packet
WFIFOW(sd->fd,2)=TOW(off);
WFIFOSET(sd->fd,off);
} else {// send static packet