summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-02-27 02:23:06 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-02-27 02:23:06 +0800
commitad792f41994ce54dc9e45fbdaaf591f38fccecee (patch)
tree2f9042554878cd443db1b422358ace08c92a6dc1 /src/map/script.c
parent06526e32ea7608dfc62ad5aeca91cf78ff3a446f (diff)
downloadhercules-ad792f41994ce54dc9e45fbdaaf591f38fccecee.tar.gz
hercules-ad792f41994ce54dc9e45fbdaaf591f38fccecee.tar.bz2
hercules-ad792f41994ce54dc9e45fbdaaf591f38fccecee.tar.xz
hercules-ad792f41994ce54dc9e45fbdaaf591f38fccecee.zip
Fixed Bug #6527
-Where all NPC don't allow changing of equipments by default and now can be set in 'items.conf'.
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;
}