summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-09-15 13:23:34 +0200
committerHaru <haru@dotalux.com>2015-10-11 00:24:21 +0200
commit437dc70ac6a19fe9a32c095ada8205dce173beb3 (patch)
tree7a8fc2106458439fc283a22157f6b0ed8ee31f8a /src/map
parentf17add758aa067f3b643e008dc42ec918b358528 (diff)
downloadhercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.gz
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.bz2
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.tar.xz
hercules-437dc70ac6a19fe9a32c095ada8205dce173beb3.zip
Changed HPM->packets[] into an array of VECTOR
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/chrif.c22
-rw-r--r--src/map/clif.c12
2 files changed, 17 insertions, 17 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 1e376e3bc..a27038ff7 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -1351,7 +1351,7 @@ void chrif_skillid2idx(int fd) {
*
*------------------------------------------*/
int chrif_parse(int fd) {
- int packet_len, cmd, r;
+ int packet_len, cmd;
// only process data from the char-server
if ( fd != chrif->fd ) {
@@ -1375,22 +1375,22 @@ int chrif_parse(int fd) {
}
}
- while ( RFIFOREST(fd) >= 2 ) {
-
- if( HPM->packetsc[hpChrif_Parse] ) {
- if( (r = HPM->parse_packets(fd,hpChrif_Parse)) ) {
- if( r == 1 ) continue;
- if( r == 2 ) return 0;
- }
+ while (RFIFOREST(fd) >= 2) {
+ if (VECTOR_LENGTH(HPM->packets[hpChrif_Parse]) > 0) {
+ int result = HPM->parse_packets(fd,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) {
- r = intif->parse(fd); // Passed on to the intif
+ int result = intif->parse(fd); // Passed on to the intif
- if (r == 1) continue; // Treated in intif
- if (r == 2) return 0; // Didn't have enough data (len==-1)
+ if (result == 1) continue; // Treated in intif
+ if (result == 2) return 0; // Didn't have enough data (len==-1)
ShowWarning("chrif_parse: session #%d, intif->parse failed (unrecognized command 0x%.4x).\n", fd, cmd);
sockt->eof(fd);
diff --git a/src/map/clif.c b/src/map/clif.c
index 59c8a7197..9c7d327e6 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18578,12 +18578,12 @@ int clif_parse(int fd) {
if (RFIFOREST(fd) < 2)
return 0;
- if( HPM->packetsc[hpClif_Parse] ) {
- int r;
- if( (r = HPM->parse_packets(fd,hpClif_Parse)) ) {
- if( r == 1 ) continue;
- if( r == 2 ) return 0;
- }
+ if (VECTOR_LENGTH(HPM->packets[hpClif_Parse]) > 0) {
+ int result = HPM->parse_packets(fd,hpClif_Parse);
+ if (result == 1)
+ continue;
+ if (result == 2)
+ return 0;
}
if( sd )