Browse Source

* Fixed the incorrect map names on the debug messages (mapid->mapindex mishap from r11508).
* Fixed the incorrect reporting of npc names being too long when the the length is 24 (from r11508).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11512 54d463be-8e91-2dee-dedb-b68131a5f0ec

FlavioJS 17 years ago
parent
commit
630552ca97
2 changed files with 9 additions and 5 deletions
  1. 4 0
      Changelog-Trunk.txt
  2. 5 5
      src/map/npc.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2007/10/18
 2007/10/18
+	* Fixed the incorrect map names on the debug messages (mapid->mapindex 
+	  mishap from r11508).
+	* Fixed the incorrect reporting of npc names being too long when the the 
+	  length is 24 (from r11508). [FlavioJS]
 	* Rev. 11511 Commented out ShowWarning and ShowDebug messages added [L0ne_W0lf]
 	* Rev. 11511 Commented out ShowWarning and ShowDebug messages added [L0ne_W0lf]
 	  in revision 11508. Aside from the ShowDebug being faulty, they
 	  in revision 11508. Aside from the ShowDebug being faulty, they
 	  are both fare too annoying for public use for the time being.
 	  are both fare too annoying for public use for the time being.

+ 5 - 5
src/map/npc.c

@@ -1430,7 +1430,7 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta
 	if( p )
 	if( p )
 	{// <Display name>::<Unique name>
 	{// <Display name>::<Unique name>
 		size_t len = p-name;
 		size_t len = p-name;
-		if( len >= NAME_LENGTH )
+		if( len > NAME_LENGTH )
 		{
 		{
 			ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 			ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 			safestrncpy(nd->name, name, sizeof(nd->name));
 			safestrncpy(nd->name, name, sizeof(nd->name));
@@ -1441,14 +1441,14 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta
 			memset(nd->name+len, 0, sizeof(nd->name)-len);
 			memset(nd->name+len, 0, sizeof(nd->name)-len);
 		}
 		}
 		len = strlen(p+2);
 		len = strlen(p+2);
-		if( len >= NAME_LENGTH )
+		if( len > NAME_LENGTH )
 			ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 			ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 		safestrncpy(nd->exname, p+2, sizeof(nd->exname));
 		safestrncpy(nd->exname, p+2, sizeof(nd->exname));
 	}
 	}
 	else
 	else
 	{// <Display name>
 	{// <Display name>
 		size_t len = strlen(name);
 		size_t len = strlen(name);
-		if( len >= NAME_LENGTH )
+		if( len > NAME_LENGTH )
 			ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 			ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
 		safestrncpy(nd->name, name, sizeof(nd->name));
 		safestrncpy(nd->name, name, sizeof(nd->name));
 		safestrncpy(nd->exname, name, sizeof(nd->exname));
 		safestrncpy(nd->exname, name, sizeof(nd->exname));
@@ -1473,8 +1473,8 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta
 		}
 		}
 		while( npc_name2id(newname) != NULL );
 		while( npc_name2id(newname) != NULL );
 
 
-		strcpy(this_mapname, (nd->bl.m==-1?"(not on a map)":mapindex_id2name(nd->bl.m)));
-		strcpy(other_mapname, (dnd->bl.m==-1?"(not on a map)":mapindex_id2name(dnd->bl.m)));
+		strcpy(this_mapname, (nd->bl.m==-1?"(not on a map)":mapindex_id2name(map[nd->bl.m].index)));
+		strcpy(other_mapname, (dnd->bl.m==-1?"(not on a map)":mapindex_id2name(map[dnd->bl.m].index)));
 
 
 		//Commented out by ME-- L0ne_W0lf, and maybe one day we'll uncomment it again
 		//Commented out by ME-- L0ne_W0lf, and maybe one day we'll uncomment it again
 		//if and when I decide to/get all the warnings nad debug messages this horrible
 		//if and when I decide to/get all the warnings nad debug messages this horrible