summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-27 03:25:51 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-27 03:25:51 +0000
commit8c87d04a1e9928626f51b290ae45228306c1d91b (patch)
tree6b88034e956d90955d7613fe0723c74db16261d1
parent49e9510c432987393d10ec1b8b1c2d416c9feb42 (diff)
downloadhercules-8c87d04a1e9928626f51b290ae45228306c1d91b.tar.gz
hercules-8c87d04a1e9928626f51b290ae45228306c1d91b.tar.bz2
hercules-8c87d04a1e9928626f51b290ae45228306c1d91b.tar.xz
hercules-8c87d04a1e9928626f51b290ae45228306c1d91b.zip
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12437 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/map.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 33a5343c4..07d672503 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -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 )
{
+ found_sd = sd;
+
if( strcmp(sd->status.name, nick) == 0 )
- {// perfect match found
- found_sd = sd;
- break;
- }
- if( found_sd != NULL )
- {// collision
- found_sd = NULL;
- break;
- }
+ break; // Perfect Match
- found_sd = sd;
+ qty++;
}
+
+ if( qty != 1 ) found_sd = NULL; // Collisions
}
else
{// exact search only