From 18757579b1a95e7fdeeaded9e0980ea9b9b65aa2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 27 Jun 2016 19:29:11 +0300 Subject: map: duplicate npc view data for each new npc. This allow use full npc copies in instances. For duplicate npc untested. --- src/emap/npc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/emap/npc.c') diff --git a/src/emap/npc.c b/src/emap/npc.c index 727ea76..9f7ce36 100644 --- a/src/emap/npc.c +++ b/src/emap/npc.c @@ -254,6 +254,7 @@ int enpc_unload_pre(struct npc_data** ndPtr, { struct npc_data *nd = *ndPtr; nullpo_ret(nd); + aFree(nd->vd); if (nd->subtype == SCRIPT) { if (nd->src_id != 0) @@ -283,3 +284,14 @@ int enpc_unload_pre(struct npc_data** ndPtr, } return 0; } + +struct view_data *enpc_get_viewdata_post(struct view_data *retVal, + int class_ __attribute__ ((unused))) +{ + nullpo_retr(NULL, retVal); + + struct view_data *vd; + CREATE(vd, struct view_data, 1); + memcpy(vd, retVal, sizeof(struct view_data)); + return vd; +} -- cgit v1.2.3-70-g09d2