summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/clif.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 1f7fbe96e..258d550d4 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -1394,16 +1394,16 @@ int chrif_parse(int fd) {
}
while (RFIFOREST(fd) >= 2) {
+ cmd = RFIFOW(fd,0);
+
if (VECTOR_LENGTH(HPM->packets[hpChrif_Parse]) > 0) {
- int result = HPM->parse_packets(fd,hpChrif_Parse);
+ int result = HPM->parse_packets(fd,cmd,hpChrif_Parse);
if (result == 1)
continue;
if (result == 2)
return 0;
}
- cmd = RFIFOW(fd,0);
-
if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(chrif->packet_len_table) || chrif->packet_len_table[cmd-0x2af8] == 0) {
int result = intif->parse(fd); // Passed on to the intif
diff --git a/src/map/clif.c b/src/map/clif.c
index 3b15265f7..817579e23 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18745,21 +18745,21 @@ int clif_parse(int fd) {
if (RFIFOREST(fd) < 2)
return 0;
+ if (sd)
+ parse_cmd_func = sd->parse_cmd_func;
+ else
+ parse_cmd_func = clif->parse_cmd;
+
+ cmd = parse_cmd_func(fd,sd);
+
if (VECTOR_LENGTH(HPM->packets[hpClif_Parse]) > 0) {
- int result = HPM->parse_packets(fd,hpClif_Parse);
+ int result = HPM->parse_packets(fd,cmd,hpClif_Parse);
if (result == 1)
continue;
if (result == 2)
return 0;
}
- if( sd )
- parse_cmd_func = sd->parse_cmd_func;
- else
- parse_cmd_func = clif->parse_cmd;
-
- cmd = parse_cmd_func(fd,sd);
-
// filter out invalid / unsupported packets
if (cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0) {
ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x (0x%04x), %"PRIuS" bytes received), disconnecting session #%d.\n",