summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-07 22:39:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-10 23:06:08 +0300
commit7614415c83f2a091302f62806e16adca1feea6bf (patch)
tree7839620990292d97fe23dc40215b1fc1545a4cd3 /src/map/script.c
parent2f488d98cacccc17d1702230488e15f7f9bc25e7 (diff)
downloadhercules-7614415c83f2a091302f62806e16adca1feea6bf.tar.gz
hercules-7614415c83f2a091302f62806e16adca1feea6bf.tar.bz2
hercules-7614415c83f2a091302f62806e16adca1feea6bf.tar.xz
hercules-7614415c83f2a091302f62806e16adca1feea6bf.zip
Move unequip item script function call into function script_run_item_unequip_script.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 190a942fb..1cad581b3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -19866,6 +19866,22 @@ void script_run_item_equip_script(struct map_session_data *sd, struct item_data
script->current_item_id = 0;
}
+void script_run_item_unequip_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull (1, 2)));
+
+/**
+ * Run item unequip script for item.
+ *
+ * @param sd player session data. Must be correct and checked before.
+ * @param data unequipped item data. Must be correct and checked before.
+ * @param oid npc id. Can be also 0 or fake npc id.
+ */
+void script_run_item_unequip_script(struct map_session_data *sd, struct item_data *data, int oid)
+{
+ script->current_item_id = data->nameid;
+ script->run(data->unequip_script, 0, sd->bl.id, oid);
+ script->current_item_id = 0;
+}
+
#define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args, false }
#define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args, false }
#define BUILDIN_DEF_DEPRECATED(x,args) { buildin_ ## x , #x , args, true }
@@ -20813,4 +20829,5 @@ void script_defaults(void) {
script->run_use_script = script_run_use_script;
script->run_item_equip_script = script_run_item_equip_script;
+ script->run_item_unequip_script = script_run_item_unequip_script;
}