summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index ed9f12c72..2eb614780 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -13416,15 +13416,21 @@ int clif_parse(int fd)
if ((int)RFIFOREST(fd) < packet_len)
return 0; // not enough data received to form the packet
- if (packet_db[packet_ver][cmd].func) {
- if (sd && sd->bl.prev == NULL && packet_db[packet_ver][cmd].func != clif_parse_LoadEndAck)
- ; //Only valid packet when player is not on a map is the finish-loading packet.
+ if( packet_db[packet_ver][cmd].func == clif_parse_debug )
+ packet_db[packet_ver][cmd].func(fd, sd);
+ else
+ if( packet_db[packet_ver][cmd].func != NULL )
+ {
+ if( !sd && packet_db[packet_ver][cmd].func != clif_parse_WantToConnection )
+ ; //Only valid packet when there is no session
+ else
+ if( sd && sd->bl.prev == NULL && packet_db[packet_ver][cmd].func != clif_parse_LoadEndAck )
+ ; //Only valid packet when player is not on a map
+ else
+ if( sd && session[sd->fd]->flag.eof )
+ ; //No more packets accepted
else
- if ((sd && sd->state.active)
- || packet_db[packet_ver][cmd].func == clif_parse_WantToConnection
- || packet_db[packet_ver][cmd].func == clif_parse_debug
- ) //Only execute the function when there's an active sd (except for debug/wanttoconnect packets)
- packet_db[packet_ver][cmd].func(fd, sd);
+ packet_db[packet_ver][cmd].func(fd, sd);
}
#if DUMP_UNKNOWN_PACKET
else if (battle_config.error_log)