summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-09-13 12:34:58 +0200
committerHaru <haru@dotalux.com>2016-09-13 12:34:58 +0200
commit19a06cae9a03ae7c390db18ca95b74bd6033dc4e (patch)
tree759c5089735df23560dfa208caa604b8e25097b2 /src/map/unit.c
parent4aa5286929b14ac52bef6959b295e189788e2578 (diff)
downloadhercules-19a06cae9a03ae7c390db18ca95b74bd6033dc4e.tar.gz
hercules-19a06cae9a03ae7c390db18ca95b74bd6033dc4e.tar.bz2
hercules-19a06cae9a03ae7c390db18ca95b74bd6033dc4e.tar.xz
hercules-19a06cae9a03ae7c390db18ca95b74bd6033dc4e.zip
Corrected a wrong check that allowed walking while casting guild skills
- The check was originally meant to have guild skills ignore SA_FREECAST (and always block movements) - Since 8953417 - Fixes #1428 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index c52683444..b919934c7 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1053,9 +1053,17 @@ int unit_can_move(struct block_list *bl) {
if (!ud)
return 0;
- if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK &&
- (!sd || (!pc->checkskill(sd, SA_FREECAST) && (skill->get_inf2(ud->skill_id) & (INF2_GUILD_SKILL | INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) == 0))) {
- return 0; // prevent moving while casting
+ if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK) {
+ // Prevent moving while casting
+ if (sd == NULL)
+ return 0; // Only players are affected by SA_FREECAST and similar
+ if ((skill->get_inf2(ud->skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) != 0) {
+ // Skills with an explicit free cast setting always allow walking
+ if ((skill->get_inf2(ud->skill_id) & INF2_GUILD_SKILL) != 0)
+ return 0; // SA_FREECAST doesn't affect guild skills
+ if (pc->checkskill(sd, SA_FREECAST) == 0)
+ return 0; // SA_FREECAST not available
+ }
}
if (DIFF_TICK(ud->canmove_tick, timer->gettick()) > 0)