Issue Information
-
#004947
-
5 - Critical
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by daniel_gp
http://www.eathena.w...er&showbug=4947
Well, since the last update to prevent the user to add himself as friend, there's a bug that crashes the map-server.
I've found it on GDB, after my server crashes twice.
I fixed it just checking if f_sd is null before comparing with sd, but i dunno if it's the right way, so...
clif.c
Before:
After:
This post has been edited by daniel_gp: Jun 3 2011, 08:41 AM
http://www.eathena.w...er&showbug=4947
Well, since the last update to prevent the user to add himself as friend, there's a bug that crashes the map-server.
I've found it on GDB, after my server crashes twice.
I fixed it just checking if f_sd is null before comparing with sd, but i dunno if it's the right way, so...
clif.c
Before:
CODE
if( sd->bl.id == f_sd->bl.id )
{// adding oneself as friend
return;
}
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
return;
}
{// adding oneself as friend
return;
}
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
return;
}
After:
CODE
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
return;
}
if( sd->bl.id == f_sd->bl.id )
{// adding oneself as friend
return;
}
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
return;
}
if( sd->bl.id == f_sd->bl.id )
{// adding oneself as friend
return;
}
This post has been edited by daniel_gp: Jun 3 2011, 08:41 AM