summaryrefslogtreecommitdiff
path: root/src/emap/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-27 19:29:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-27 19:29:11 +0300
commit18757579b1a95e7fdeeaded9e0980ea9b9b65aa2 (patch)
tree3cde5e6f79c1047ff50a504f91719d69ba40ddc1 /src/emap/npc.c
parent7cbf9606d7da6e452893e446a4099b92dc8bf32e (diff)
downloadevol-hercules-18757579b1a95e7fdeeaded9e0980ea9b9b65aa2.tar.gz
evol-hercules-18757579b1a95e7fdeeaded9e0980ea9b9b65aa2.tar.bz2
evol-hercules-18757579b1a95e7fdeeaded9e0980ea9b9b65aa2.tar.xz
evol-hercules-18757579b1a95e7fdeeaded9e0980ea9b9b65aa2.zip
map: duplicate npc view data for each new npc.
This allow use full npc copies in instances. For duplicate npc untested.
Diffstat (limited to 'src/emap/npc.c')
-rw-r--r--src/emap/npc.c12
1 files changed, 12 insertions, 0 deletions
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;
+}