summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorshennetsind <notind@gmail.com>2013-08-08 11:19:02 -0700
committershennetsind <notind@gmail.com>2013-08-08 11:19:02 -0700
commit1197e46b6ca1f399edc18fbd60a3e2c4adf6c32f (patch)
treecbfd9f0847cb5b9e65cd77ab4e8861f34165c67d /src/map/chrif.c
parentdefac0ef9714121a872ab48c3f6c4ddd177ae509 (diff)
parent04db720ee56ad8ddddf4255575c5d60e2c214a13 (diff)
downloadhercules-1197e46b6ca1f399edc18fbd60a3e2c4adf6c32f.tar.gz
hercules-1197e46b6ca1f399edc18fbd60a3e2c4adf6c32f.tar.bz2
hercules-1197e46b6ca1f399edc18fbd60a3e2c4adf6c32f.tar.xz
hercules-1197e46b6ca1f399edc18fbd60a3e2c4adf6c32f.zip
Merge pull request #83 from HerculesWS/HPMUpdateR2
Hercules Plugin Manager Update
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index d44ccf721..6b0397b56 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -10,6 +10,7 @@
#include "../common/showmsg.h"
#include "../common/strlib.h"
#include "../common/ers.h"
+#include "../common/HPM.h"
#include "map.h"
#include "battle.h"
@@ -1396,7 +1397,7 @@ void chrif_skillid2idx(int fd) {
*
*------------------------------------------*/
int chrif_parse(int fd) {
- int packet_len, cmd;
+ int packet_len, cmd, r;
// only process data from the char-server
if ( fd != char_fd ) {
@@ -1421,9 +1422,18 @@ 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;
+ }
+ }
+
cmd = RFIFOW(fd,0);
+
if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(packet_len_table) || packet_len_table[cmd-0x2af8] == 0) {
- int r = intif->parse(fd); // Passed on to the intif
+ r = 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)