summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-08 06:48:16 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-08 06:48:16 +0000
commitb2ad735efc1798101018d4e0973d7bea681a1310 (patch)
tree63fde029e8036e572b1ae4610b0f7b176b61626d /src/map/npc.c
parent1811436903c5383e8f3eeacdd88bd7eece6c7998 (diff)
downloadhercules-b2ad735efc1798101018d4e0973d7bea681a1310.tar.gz
hercules-b2ad735efc1798101018d4e0973d7bea681a1310.tar.bz2
hercules-b2ad735efc1798101018d4e0973d7bea681a1310.tar.xz
hercules-b2ad735efc1798101018d4e0973d7bea681a1310.zip
- Added function status_change_init to initialize all the sc timers. Added sc_data initialization to the npc structures who were missing them.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5953 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 3c20b5691..13e1cc195 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1494,8 +1494,9 @@ int npc_parse_warp (char *w1,char *w2,char *w3,char *w4)
nd->bl.type = BL_NPC;
nd->bl.subtype = WARP;
map_addblock(&nd->bl);
- unit_dataset(&nd->bl);
status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
clif_spawn(&nd->bl);
strdb_put(npcname_db, nd->name, nd);
@@ -1580,12 +1581,13 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4)
npc_shop++;
nd->bl.type = BL_NPC;
nd->bl.subtype = SHOP;
- unit_dataset(&nd->bl);
- nd->ud.dir = dir;
if (m >= 0) {
nd->n = map_addnpc(m,nd);
map_addblock(&nd->bl);
status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
+ nd->ud.dir = dir;
clif_spawn(&nd->bl);
} else
// we skip map_addnpc, but still add it to the list of ID's
@@ -1880,13 +1882,15 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
npc_script++;
nd->bl.type = BL_NPC;
nd->bl.subtype = SCRIPT;
- unit_dataset(&nd->bl);
- nd->ud.dir = dir;
for (i = 0; i < MAX_EVENTTIMER; i++)
nd->eventtimer[i] = -1;
if (m >= 0) {
nd->n = map_addnpc(m, nd);
+ status_set_viewdata(&nd->bl, nd->class_);
+ status_change_init(&nd->bl);
+ unit_dataset(&nd->bl);
+ nd->ud.dir = dir;
map_addblock(&nd->bl);
if (evflag) { // ƒCƒxƒ“ƒgŒ^
struct event_data *ev = (struct event_data *)aCalloc(1, sizeof(struct event_data));
@@ -1894,7 +1898,6 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
ev->pos = 0;
strdb_put(ev_db, nd->exname, ev);
} else {
- status_set_viewdata(&nd->bl, nd->class_);
clif_spawn(&nd->bl);
}
} else {