|
@@ -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;
|
|
}
|
|
}
|
|
|
|
|