summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c4ee96feb..604872dfd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3017,6 +3017,7 @@ struct script_state* script_alloc_state(struct script_code* script, int pos, int
st->rid = rid;
st->oid = oid;
st->sleep.timer = INVALID_TIMER;
+ st->npc_item_flag = battle_config.item_enabled_npc;
return st;
}
@@ -3644,6 +3645,7 @@ static void script_attach_state(struct script_state* st)
}
sd->st = st;
sd->npc_id = st->oid;
+ sd->npc_item_flag = st->npc_item_flag; // load default.
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
@@ -6964,7 +6966,7 @@ BUILDIN_FUNC(enableitemuse)
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
- sd->npc_item_flag = st->oid;
+ st->npc_item_flag = sd->npc_item_flag = 1;
return 0;
}
@@ -6973,7 +6975,7 @@ BUILDIN_FUNC(disableitemuse)
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
- sd->npc_item_flag = 0;
+ st->npc_item_flag = sd->npc_item_flag = 0;
return 0;
}