summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/pc.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index e34f765..7b0af59 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -2260,10 +2260,11 @@ int pc_useitem(dumb_ptr<map_session_data> sd, int n)
return 1;
}
- run_script(ScriptPointer(sd->inventory_data[n]->use_script.get(), 0), sd->bl_id, 0);
-
+ const ScriptBuffer *script = sd->inventory_data[n]->use_script.get();
clif_useitemack(sd, n, amount - 1, 1);
pc_delitem(sd, n, 1, 1);
+
+ run_script(ScriptPointer(script, 0), sd->bl_id, 0);
}
return 0;