summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-11 21:35:47 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-14 22:35:09 +0100
commitb6ecc4bf45b87261f4269e7d61683126c40780f1 (patch)
tree7118d637d52610f004287008252d4a5eac401575 /src
parent0a1982baa30e29431622c1a4f52668756d563214 (diff)
downloadhercules-b6ecc4bf45b87261f4269e7d61683126c40780f1.tar.gz
hercules-b6ecc4bf45b87261f4269e7d61683126c40780f1.tar.bz2
hercules-b6ecc4bf45b87261f4269e7d61683126c40780f1.tar.xz
hercules-b6ecc4bf45b87261f4269e7d61683126c40780f1.zip
Add pc_autocast_clear() function calls
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c10
5 files changed, 18 insertions, 10 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 410cd7af7..d3368c3b0 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5671,6 +5671,8 @@ ACMD(useskill)
return false;
}
+ pc->autocast_clear(sd);
+
if (skill_id >= HM_SKILLBASE && skill_id < HM_SKILLBASE+MAX_HOMUNSKILL
&& sd->hd && homun_alive(sd->hd)) // (If used with @useskill, put the homunc as dest)
bl = &sd->hd->bl;
diff --git a/src/map/clif.c b/src/map/clif.c
index d7dffb293..6c693297d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -12786,7 +12786,7 @@ static void clif_useSkillToIdReal(int fd, struct map_session_data *sd, int skill
return;
}
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
if (skill_id >= GD_SKILLBASE && skill_id < GD_MAX) {
if (sd->state.gmaster_flag)
@@ -12914,7 +12914,7 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
unit->skilluse_pos(&sd->bl, x, y, skill_id, skill_lv);
} else {
int lv;
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
if( (lv = pc->checkskill(sd, skill_id)) > 0 ) {
if( skill_lv > lv )
skill_lv = lv;
diff --git a/src/map/pc.c b/src/map/pc.c
index 073c16029..b37afab86 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -8129,9 +8129,9 @@ static int pc_dead(struct map_session_data *sd, struct block_list *src)
clif->party_dead_notification(sd);
- //Reset menu skills/item skills
- if (sd->skillitem)
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd); // Unset auto-cast data.
+
+ // Reset menu skills.
if (sd->menuskill_id)
sd->menuskill_id = sd->menuskill_val = 0;
//Reset ticks.
diff --git a/src/map/script.c b/src/map/script.c
index b08613ec3..5e285020f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -21436,7 +21436,10 @@ static BUILDIN(unitskilluseid)
} else {
status_calc_npc(nd, SCO_NONE);
}
+ } else if (bl->type == BL_PC) {
+ pc->autocast_clear(BL_UCAST(BL_PC, bl));
}
+
unit->skilluse_id(bl, target_id, skill_id, skill_lv);
}
@@ -21472,7 +21475,10 @@ static BUILDIN(unitskillusepos)
} else {
status_calc_npc(nd, SCO_NONE);
}
+ } else if (bl->type == BL_PC) {
+ pc->autocast_clear(BL_UCAST(BL_PC, bl));
}
+
unit->skilluse_pos(bl, skill_x, skill_y, skill_id, skill_lv);
}
diff --git a/src/map/skill.c b/src/map/skill.c
index f28d50c6e..f679c3f6a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5883,7 +5883,7 @@ static int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
}
if( sd && ud->skill_id != SA_ABRACADABRA && ud->skill_id != WM_RANDOMIZESPELL ) // they just set the data so leave it as it is.[Inkfish]
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
if (ud->skilltimer == INVALID_TIMER) {
if(md) md->skill_idx = -1;
@@ -5939,7 +5939,7 @@ static int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
//sent in ALL cases, even cases where skill_check_condition fails
//which would lead to double 'skill failed' messages u.u [Skotlex]
if(sd)
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
else if(md)
md->skill_idx = -1;
return 0;
@@ -10870,7 +10870,7 @@ static int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
skill->castend_pos2(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv,tick,0);
if( sd && sd->skillitem != AL_WARP ) // Warp-Portal thru items will clear data in skill_castend_map. [Inkfish]
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
unit->set_dir(src, map->calc_dir(src, ud->skillx, ud->skilly));
@@ -10888,7 +10888,7 @@ static int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
ud->canact_tick = tick;
ud->skill_id = ud->skill_lv = 0;
if(sd)
- sd->skillitem = sd->skillitemlv = 0;
+ pc->autocast_clear(sd);
else if(md)
md->skill_idx = -1;
return 0;
@@ -11041,7 +11041,7 @@ static int skill_castend_map(struct map_session_data *sd, uint16 skill_id, const
}
skill->consume_requirement(sd,sd->menuskill_id,lv,2);
- sd->skillitem = sd->skillitemlv = 0; // Clear data that's skipped in 'skill_castend_pos' [Inkfish]
+ pc->autocast_clear(sd); // Clear data which was skipped in skill_castend_pos().
if((group=skill->unitsetting(&sd->bl,skill_id,lv,wx,wy,0))==NULL) {
skill_failed(sd);