summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-05 07:21:23 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-05 07:21:23 +0100
commit0c99331676fc31cc040c78393d90b52f32128103 (patch)
tree510f59c0a204e036cad08f22c7fd3fb07858e2fd
parent9106bbab19b4feaa4623a3b8e5d59e08ef73b640 (diff)
downloadhercules-0c99331676fc31cc040c78393d90b52f32128103.tar.gz
hercules-0c99331676fc31cc040c78393d90b52f32128103.tar.bz2
hercules-0c99331676fc31cc040c78393d90b52f32128103.tar.xz
hercules-0c99331676fc31cc040c78393d90b52f32128103.zip
Fix conditions to call pc_itemskill_clear() function
-rw-r--r--src/map/unit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 29a01aea7..ee6159959 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1046,7 +1046,7 @@ static int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_
int ret = unit->skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel);
struct map_session_data *sd = BL_CAST(BL_PC, src);
- if (sd != NULL)
+ if (sd != NULL && (ret == 0 || !skill->is_item_skill(sd, skill_id, skill_lv)))
pc->itemskill_clear(sd);
return ret;
@@ -1683,7 +1683,7 @@ static int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_
int ret = unit->skilluse_pos2(src, skill_x, skill_y, skill_id, skill_lv, casttime, castcancel);
struct map_session_data *sd = BL_CAST(BL_PC, src);
- if (sd != NULL)
+ if (sd != NULL && (ret == 0 || !skill->is_item_skill(sd, skill_id, skill_lv)))
pc->itemskill_clear(sd);
return ret;