summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-14 08:57:38 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-14 08:57:38 +0000
commit88738b21b41d5074d62962ffdae367755a828a90 (patch)
tree1e83dea44fd0faf9b3e10eca50dba522d29a51b2
parent6d3782b5ed8d96105d8098ef5437e3c9afa5d03d (diff)
downloadhercules-88738b21b41d5074d62962ffdae367755a828a90.tar.gz
hercules-88738b21b41d5074d62962ffdae367755a828a90.tar.bz2
hercules-88738b21b41d5074d62962ffdae367755a828a90.tar.xz
hercules-88738b21b41d5074d62962ffdae367755a828a90.zip
- A quick fix for lazy scripters -_- sheesh
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7154 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/npc.c22
2 files changed, 11 insertions, 13 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 71c051380..5ce09114c 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -7,8 +7,6 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
* [Improved]:
- script_save_mapreg for MapregSQL Saving to display perfomance only in slow
queries. [Lance]
- * [Improved]:
- - npc_parse_script to show information and remove duplicated NPCs [Lance]
2006/06/13
* Updated mob_db.sql and item_db.sql to latest. [Skotlex]
* Added account_id index to char table. Thanks to Buuyo for reporting it.
diff --git a/src/map/npc.c b/src/map/npc.c
index 5ba7696d1..c5264974b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1898,19 +1898,19 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
} else {
// duplicateする
char srcname[128];
- struct npc_data *nd2;
+ struct npc_data *dnd;
if (sscanf(w2, "duplicate(%[^)])", srcname) != 1) {
ShowError("bad duplicate name (in %s)! : %s", current_file, w2);
return 0;
}
- if ((nd2 = npc_name2id(srcname)) == NULL) {
+ if ((dnd = npc_name2id(srcname)) == NULL) {
ShowError("bad duplicate name (in %s)! (not exist) : %s\n", current_file, srcname);
return 0;
}
- script = nd2->u.scr.script;
- label_dup = nd2->u.scr.label_list;
- label_dupnum = nd2->u.scr.label_list_num;
- src_id = nd2->bl.id;
+ script = dnd->u.scr.script;
+ label_dup = dnd->u.scr.label_list;
+ label_dupnum = dnd->u.scr.label_list_num;
+ src_id = dnd->bl.id;
}// end of スクリプト解析
@@ -1953,6 +1953,11 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
memcpy(nd->exname, w3, NAME_LENGTH-1);
}
+ if((dnd = npc_name2id(nd->exname))){
+ ShowInfo("npc_parse_script: Overriding NPC '%s::%s' to '%s::%d'.. (Duplicated System Name - Lazy scripters >_>) \n",nd->name,nd->exname,nd->name,npc_script);
+ sprintf(nd->exname, "%d", npc_script);
+ }
+
nd->bl.prev = nd->bl.next = NULL;
nd->bl.m = m;
nd->bl.x = x;
@@ -1967,11 +1972,6 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
nd->bl.type = BL_NPC;
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++)
nd->eventtimer[i] = -1;
if (m >= 0) {