- Fixed a bug in map_nick2sd (sometimes we can have 3 chars with similar names, and the "perfect match" in the 3º slot... or more).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12437 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
94943b2b6a
commit
0c92c0f672
@ -1693,21 +1693,19 @@ struct map_session_data * map_nick2sd(const char *nick)
|
||||
{
|
||||
if( battle_config.partial_name_scan )
|
||||
{// partial name search
|
||||
int qty = 0;
|
||||
|
||||
if( strnicmp(sd->status.name, nick, nicklen) == 0 )
|
||||
{
|
||||
if( strcmp(sd->status.name, nick) == 0 )
|
||||
{// perfect match found
|
||||
found_sd = sd;
|
||||
break;
|
||||
}
|
||||
if( found_sd != NULL )
|
||||
{// collision
|
||||
found_sd = NULL;
|
||||
break;
|
||||
|
||||
if( strcmp(sd->status.name, nick) == 0 )
|
||||
break; // Perfect Match
|
||||
|
||||
qty++;
|
||||
}
|
||||
|
||||
found_sd = sd;
|
||||
}
|
||||
if( qty != 1 ) found_sd = NULL; // Collisions
|
||||
}
|
||||
else
|
||||
{// exact search only
|
||||
|
Loading…
x
Reference in New Issue
Block a user