summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-11 16:53:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-11 16:53:40 +0000
commit8f4dbaee5eaa399779898e6d69482b7c48504ce1 (patch)
tree8b7c4cb6922abfc3634570d2ab6049cc54be5c34 /src/map/npc.c
parent7e393bf3392bf9e0522528051bb56cb750307d8e (diff)
downloadhercules-8f4dbaee5eaa399779898e6d69482b7c48504ce1.tar.gz
hercules-8f4dbaee5eaa399779898e6d69482b7c48504ce1.tar.bz2
hercules-8f4dbaee5eaa399779898e6d69482b7c48504ce1.tar.xz
hercules-8f4dbaee5eaa399779898e6d69482b7c48504ce1.zip
- Fixed crash caused by fake-NPC (some fields were not initialized to NULL, I think it's safer to just use aCalloc rather than aMalloc here)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10217 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 16152ecfa..531ea83cb 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3199,17 +3199,11 @@ int do_init_npc(void)
add_timer_func_list(npc_timerevent,"npc_timerevent");
// Init dummy NPC
- fake_nd = (struct npc_data *)aMalloc(sizeof(struct npc_data));
- fake_nd->bl.prev = fake_nd->bl.next = NULL;
+ fake_nd = (struct npc_data *)aCalloc(1,sizeof(struct npc_data));
fake_nd->bl.m = -1;
- fake_nd->bl.x = 0;
- fake_nd->bl.y = 0;
fake_nd->bl.id = npc_get_new_npc_id();
fake_nd->class_ = -1;
fake_nd->speed = 200;
- fake_nd->u.scr.script = NULL;
- fake_nd->u.scr.src_id = 0;
- fake_nd->chatdb = NULL;
for (i = 0; i < MAX_EVENTTIMER; i++)
fake_nd->eventtimer[i] = -1;
strcpy(fake_nd->name,"FAKE_NPC");