summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)