viewing paste Unknown #35548 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
 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;
 
Viewed 870 times, submitted by Guest.