summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-11 22:07:36 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-14 22:35:09 +0100
commitb151b29cf072ed336214c2d0ca43e6db34a773ad (patch)
treedb0788eab9cc3c341b5ae1cbf93a068383a4e873 /src/map/clif.c
parent4470161450c46a8cb52cb095577b43f2b6e29e5a (diff)
downloadhercules-b151b29cf072ed336214c2d0ca43e6db34a773ad.tar.gz
hercules-b151b29cf072ed336214c2d0ca43e6db34a773ad.tar.bz2
hercules-b151b29cf072ed336214c2d0ca43e6db34a773ad.tar.xz
hercules-b151b29cf072ed336214c2d0ca43e6db34a773ad.zip
Add skill_validate_autocast_data() function calls
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 6c693297d..66533a6fc 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -12706,6 +12706,14 @@ static void clif_useSkillToIdReal(int fd, struct map_session_data *sd, int skill
{
int64 tick = timer->gettick();
+ /**
+ * According to Skotlex' comment below, the client sometimes passes 0 for the skill level.
+ * Even though this seems to only affect guild skills, sd->autocast.skill_lv is used
+ * for the auto-cast data validation if skill_lv is 0.
+ *
+ **/
+ skill->validate_autocast_data(sd, skill_id, (skill_lv == 0) ? sd->autocast.skill_lv : skill_lv);
+
if (skill_lv < 1)
skill_lv = 1; //No clue, I have seen the client do this with guild skills :/ [Skotlex]
@@ -12847,6 +12855,16 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
int64 tick = timer->gettick();
nullpo_retv(sd);
+
+ /**
+ * When using clif_item_skill() to initiate the execution of ground skills,
+ * the client sometimes passes 0 for the skill level in packet 0x0af4.
+ * In that case sd->autocast.skill_lv is used for the auto-cast data validation,
+ * since clif_item_skill() is only used for auto-cast skills.
+ *
+ **/
+ skill->validate_autocast_data(sd, skill_id, (skill_lv == 0) ? sd->autocast.skill_lv : skill_lv);
+
if( !(skill->get_inf(skill_id)&INF_GROUND_SKILL) )
return; //Using a target skill on the ground? WRONG.
@@ -12985,6 +13003,12 @@ static void clif_parse_UseSkillMap(int fd, struct map_session_data *sd)
return;
}
+ /**
+ * Since no skill level was passed use 0 to notify skill_validate_autocast_data() of this special case.
+ *
+ **/
+ skill->validate_autocast_data(sd, skill_id, 0);
+
pc->delinvincibletimer(sd);
skill->castend_map(sd,skill_id,map_name);
pc->autocast_clear(sd);