浏览代码

Fixed strnpcinfo(1) returning blank strings when NPC names did not have a hidden portion of the display name. (bugreport:3758)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14170 54d463be-8e91-2dee-dedb-b68131a5f0ec
Paradox924X 15 年之前
父节点
当前提交
10c788b2da
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 2 0
      Changelog-Trunk.txt
  2. 3 2
      src/map/script.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 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.
 
 
+2009/11/25
+	* Fixed strnpcinfo(1) returning blank strings when NPC names did not have a hidden portion of the display name. (bugreport:3758) [Paradox924X]
 2009/11/23
 2009/11/23
 	* Fixed player keeps bleeding when dead. [Inkfish]
 	* Fixed player keeps bleeding when dead. [Inkfish]
 	- If battle_config.invincible_nodamage is true, reflected damage to targets in invincible status is now 1.
 	- If battle_config.invincible_nodamage is true, reflected damage to targets in invincible status is now 1.

+ 3 - 2
src/map/script.c

@@ -6118,12 +6118,13 @@ BUILDIN_FUNC(strnpcinfo)
 		case 0: // display name
 		case 0: // display name
 			name = aStrdup(nd->name);
 			name = aStrdup(nd->name);
 			break;
 			break;
-		case 1: // visible part of display name name
+		case 1: // visible part of display name
 			if((buf = strchr(nd->name,'#')) != NULL)
 			if((buf = strchr(nd->name,'#')) != NULL)
 			{
 			{
 				name = aStrdup(nd->name);
 				name = aStrdup(nd->name);
 				name[buf - nd->name] = 0;
 				name[buf - nd->name] = 0;
-			}
+			} else // Return the name, there is no '#' present
+				name = aStrdup(nd->name);
 			break;
 			break;
 		case 2: // # fragment
 		case 2: // # fragment
 			if((buf = strchr(nd->name,'#')) != NULL)
 			if((buf = strchr(nd->name,'#')) != NULL)