src/map/clif.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/map/clif.c b/src/map/clif.c
index 12945a6..4e14447 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -501,7 +501,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
if( (sd = p->data[i].sd) == NULL )
continue;
- if( !(fd=sd->fd) )
+ if( !(fd=sd->fd) || fd < 0 )
continue;
if( sd->bl.id == bl->id && (type == PARTY_WOS || type == PARTY_SAMEMAP_WOS || type == PARTY_AREA_WOS) )
@@ -586,8 +586,15 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
if (g) {
for(i = 0; i < g->max_member; i++) {
if( (sd = g->member[i].sd) != NULL ) {
- if( !(fd=sd->fd) )
+ if( !(fd=sd->fd) || fd < 0 )
continue;
+ if (!sockt->session_is_valid(fd)) {
+ ShowError("Invalid guild member fd found: %d\n", fd);
+ ShowError("report to devs\n");
+ Assert_report(0);
+ ShowError("trying to fix it...\n");
+ g->member[i].sd = NULL;
+ }
if( type == GUILD_NOBG && sd->bg_id )
continue;