summaryrefslogtreecommitdiff
path: root/src/emap/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-28 16:25:05 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-28 16:25:05 +0300
commit110413932c6fc756420eba6189acead09f4877a0 (patch)
treee9b84222fc5a9920841f8a906b38cb9e4cbc4e03 /src/emap/npc.c
parent18757579b1a95e7fdeeaded9e0980ea9b9b65aa2 (diff)
downloadevol-hercules-110413932c6fc756420eba6189acead09f4877a0.tar.gz
evol-hercules-110413932c6fc756420eba6189acead09f4877a0.tar.bz2
evol-hercules-110413932c6fc756420eba6189acead09f4877a0.tar.xz
evol-hercules-110413932c6fc756420eba6189acead09f4877a0.zip
Update plugin after hercules update.
Changed a bit npc internal struct types.
Diffstat (limited to 'src/emap/npc.c')
-rw-r--r--src/emap/npc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/emap/npc.c b/src/emap/npc.c
index 9f7ce36..59f41cf 100644
--- a/src/emap/npc.c
+++ b/src/emap/npc.c
@@ -178,11 +178,12 @@ bool enpc_duplicate_script_sub_pre(struct npc_data **ndPtr,
nd->u.scr.trader = snd->u.scr.trader;
struct script_code *code;
- const int sz = snd->u.scr.script->script_size;
CREATE(code, struct script_code, 1);
- code->script_buf = (unsigned char *)aMalloc(sz * sizeof(unsigned char));
- memcpy(code->script_buf, snd->u.scr.script->script_buf, sz);
- code->script_size = sz;
+
+ const int sz = VECTOR_LENGTH(snd->u.scr.script->script_buf);
+ VECTOR_ENSURE(code->script_buf, sz , 1);
+ VECTOR_PUSHARRAY(code->script_buf, VECTOR_DATA(snd->u.scr.script->script_buf), sz);
+
code->local.vars = NULL;
code->local.arrays = NULL;
nd->u.scr.script = code;
@@ -259,7 +260,6 @@ int enpc_unload_pre(struct npc_data** ndPtr,
{
if (nd->src_id != 0)
{
- ShowWarning("npc_unload 5: %d\n", nd->bl.id);
if (nd->u.scr.script)
{
script->free_code(nd->u.scr.script);