summaryrefslogtreecommitdiff
path: root/src/emap/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/status.c')
-rw-r--r--src/emap/status.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/emap/status.c b/src/emap/status.c
index 90c25d4..1b27a0f 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -10,6 +10,7 @@
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "map/itemdb.h"
@@ -21,6 +22,8 @@
#include "plugins/HPMHooking.h"
+#include "emap/npc.h"
+
#include "emap/horse.h"
#include "emap/data/itemd.h"
#include "emap/data/npcd.h"
@@ -52,13 +55,7 @@ void estatus_set_viewdata_post(struct block_list *bl,
if (npc->subtype == SCRIPT)
{
if (npc->u.scr.script)
- {
- // here some magic to set npc local variable .id to bl.id
- const int num = (int)reference_uid(script->add_str(".id"), 0);
- if (!npc->u.scr.script->local.vars)
- npc->u.scr.script->local.vars = i64db_alloc(DB_OPT_RELEASE_DATA);
- i64db_iput(npc->u.scr.script->local.vars, num, npc->bl.id);
- }
+ enpc_set_var_num(npc, ".id", npc->bl.id);
}
}
}