summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-06 00:50:29 +0300
committerAndrei Karas <akaras@inbox.ru>2018-11-14 06:00:50 +0300
commit27fb22d9f492cffe206594e5af0f854cf8fa3ce5 (patch)
tree4772665b8623529df9a048e24a9bbd858b406e4c /src/map/atcommand.c
parenta9caa4ea37115869eb3926ca6e4c53709e7d9337 (diff)
downloadhercules-27fb22d9f492cffe206594e5af0f854cf8fa3ce5.tar.gz
hercules-27fb22d9f492cffe206594e5af0f854cf8fa3ce5.tar.bz2
hercules-27fb22d9f492cffe206594e5af0f854cf8fa3ce5.tar.xz
hercules-27fb22d9f492cffe206594e5af0f854cf8fa3ce5.zip
Use new packet tables for packets len.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d65af9dd1..e6f022a10 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -263,12 +263,15 @@ ACMD(send)
if (len) {
// show packet length
- safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, clif->packet(type)->len); // Packet 0x%x length: %d
+ Assert_retr(false, type <= MAX_PACKET_DB && type >= MIN_PACKET_DB);
+ len = packets->db[type];
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
return true;
}
- len = clif->packet(type)->len;
+ Assert_retr(false, type <= MAX_PACKET_DB && type >= MIN_PACKET_DB);
+ len = packets->db[type];
if (len == -1) {
// dynamic packet
@@ -416,7 +419,7 @@ ACMD(send)
SKIP_VALUE(message);
}
- if (clif->packet(type)->len == -1) { // send dynamic packet
+ if (packets->db[type] == -1) { // send dynamic packet
WFIFOW(sd->fd,2)=TOW(off);
WFIFOSET(sd->fd,off);
} else {// send static packet