summaryrefslogtreecommitdiff
path: root/src/map/mob.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/mob.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/mob.c')
-rw-r--r--src/map/mob.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index d237f4109..68addb39c 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -186,7 +186,6 @@ int mob_parse_dataset(struct spawn_data *data) {
struct mob_data* mob_spawn_dataset(struct spawn_data *data)
{
struct mob_data *md = aCalloc(1, sizeof(struct mob_data));
- int i;
md->bl.id= npc_get_new_npc_id();
md->bl.type = BL_MOB;
md->bl.subtype = MONS;
@@ -210,9 +209,10 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data)
md->spawn_n = -1;
md->deletetimer = -1;
md->skillidx = -1;
- for (i = 0; i < MAX_STATUSCHANGE; i++)
- md->sc.data[i].timer = -1;
status_set_viewdata(&md->bl, md->class_);
+ status_change_init(&md->bl);
+ unit_dataset(&md->bl);
+
map_addiddb(&md->bl);
return md;
}
@@ -708,7 +708,6 @@ int mob_spawn (struct mob_data *md)
md->state.skillstate = MSS_IDLE;
md->next_walktime = tick+rand()%5000+1000;
md->last_linktime = tick;
- unit_dataset(&md->bl);
/* Guardians should be spawned using mob_spawn_guardian! [Skotlex]
* and the Emperium is spawned using mob_once_spawn.