Browse Source

* [Improved]:
- npc_parse_script to show information and remove duplicated NPCs.

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

Lance 19 years ago
parent
commit
54b592fe29
2 changed files with 9 additions and 1 deletions
  1. 3 0
      Changelog-Trunk.txt
  2. 6 1
      src/map/npc.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ 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.
 
 
+2006/06/14
+	* [Improved]:
+	  - npc_parse_script to show information and remove duplicated NPCs [Lance]
 2006/06/13
 2006/06/13
 	* Updated mob_db.sql and item_db.sql to latest. [Skotlex]
 	* Updated mob_db.sql and item_db.sql to latest. [Skotlex]
 	* Added account_id index to char table. Thanks to Buuyo for reporting it.
 	* Added account_id index to char table. Thanks to Buuyo for reporting it.

+ 6 - 1
src/map/npc.c

@@ -1835,7 +1835,7 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
 	int startline = 0;
 	int startline = 0;
 	unsigned char line[1024];
 	unsigned char line[1024];
 	int i;
 	int i;
-	struct npc_data *nd;
+	struct npc_data *nd, *dnd;
 	struct dbt *label_db;
 	struct dbt *label_db;
 	char *p;
 	char *p;
 	struct npc_label_list *label_dup = NULL;
 	struct npc_label_list *label_dup = NULL;
@@ -1967,6 +1967,11 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
 	nd->bl.type = BL_NPC;
 	nd->bl.type = BL_NPC;
 	nd->bl.subtype = SCRIPT;
 	nd->bl.subtype = SCRIPT;
 
 
+	if((dnd = npc_name2id(nd->exname))){
+		ShowInfo("npc_parse_script: Removing duplicated NPC '%s::%s'...\n", dnd->name, dnd->exname);
+		npc_unload(dnd);
+	}
+
 	for (i = 0; i < MAX_EVENTTIMER; i++)
 	for (i = 0; i < MAX_EVENTTIMER; i++)
 		nd->eventtimer[i] = -1;
 		nd->eventtimer[i] = -1;
 	if (m >= 0) {
 	if (m >= 0) {