- Fixing a bug in map_nick2sd. Also fixed on Stable.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12445 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
00f560c339
commit
b70caae42f
@ -1681,6 +1681,7 @@ struct map_session_data * map_nick2sd(const char *nick)
|
|||||||
struct map_session_data* found_sd;
|
struct map_session_data* found_sd;
|
||||||
struct s_mapiterator* iter;
|
struct s_mapiterator* iter;
|
||||||
size_t nicklen;
|
size_t nicklen;
|
||||||
|
int qty = 0;
|
||||||
|
|
||||||
if( nick == NULL )
|
if( nick == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1693,32 +1694,30 @@ struct map_session_data * map_nick2sd(const char *nick)
|
|||||||
{
|
{
|
||||||
if( battle_config.partial_name_scan )
|
if( battle_config.partial_name_scan )
|
||||||
{// partial name search
|
{// partial name search
|
||||||
int qty = 0;
|
|
||||||
|
|
||||||
if( strnicmp(sd->status.name, nick, nicklen) == 0 )
|
if( strnicmp(sd->status.name, nick, nicklen) == 0 )
|
||||||
{
|
{
|
||||||
found_sd = sd;
|
found_sd = sd;
|
||||||
|
|
||||||
if( strcmp(sd->status.name, nick) == 0 )
|
if( strcmp(sd->status.name, nick) == 0 )
|
||||||
break; // Perfect Match
|
{// Perfect Match
|
||||||
|
qty = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
qty++;
|
qty++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( qty != 1 ) found_sd = NULL; // Collisions
|
|
||||||
}
|
}
|
||||||
else
|
else if( strcasecmp(sd->status.name, nick) == 0 )
|
||||||
{// exact search only
|
{// exact search only
|
||||||
if( strcasecmp(sd->status.name, nick) == 0 )
|
found_sd = sd;
|
||||||
{
|
break;
|
||||||
found_sd = sd;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mapit_free(iter);
|
mapit_free(iter);
|
||||||
|
|
||||||
|
if( battle_config.partial_name_scan && qty != 1 )
|
||||||
|
found_sd = NULL;
|
||||||
|
|
||||||
return found_sd;
|
return found_sd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user