From 4bc69f5b2763b074b1e25d290c4b4493b3e89f03 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sat, 4 Jan 2020 19:45:03 +0800 Subject: [PATCH] Fix --- libs/items.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/items.js b/libs/items.js index f65e8f54..4f0fa179 100644 --- a/libs/items.js +++ b/libs/items.js @@ -70,6 +70,15 @@ items.prototype.getItemEffect = function (itemId, itemNum) { } } core.status.hero.statistics.hp += core.status.hero.hp - curr_hp; + + if (this.useItemEvent[itemId]) { + try { + core.insertAction(this.useItemEvent[itemId]); + } + catch (e) { + main.log(e); + } + } } else { core.addItem(itemId, itemNum); @@ -90,14 +99,6 @@ items.prototype.getItemEffectTip = function (itemId) { return ""; } } - if (this.useItemEvent[itemId]) { - try { - core.insertAction(this.useItemEvent[itemId]); - } - catch (e) { - main.log(e); - } - } } return ""; }