From b2ad735efc1798101018d4e0973d7bea681a1310 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sat, 8 Apr 2006 06:48:16 +0000 Subject: - 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 --- src/map/npc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/map/npc.c') 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 { -- cgit v1.2.3-70-g09d2