diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/unit.c | 14 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/map/map.c b/src/map/map.c index e901eb6b9..d22b28689 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3996,7 +3996,7 @@ bool map_config_read_map_list(const char *filename, struct config_t *config, boo nullpo_retr(false, filename); nullpo_retr(false, config); - deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH); // Remove maps if ((setting = libconfig->lookup(config, "map_configuration/map_removed")) != NULL) { diff --git a/src/map/skill.c b/src/map/skill.c index 561154bdf..5e32e922c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -18995,7 +18995,7 @@ void skill_config_set_level(struct config_setting_t *conf, int *arr) if (config_setting_is_group(conf)) { for (i=0; i<MAX_SKILL_LEVEL; i++) { - char level[5]; + char level[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL sprintf(level, "Lv%d", i+1); libconfig->setting_lookup_int(conf, level, &arr[i]); } @@ -19259,7 +19259,7 @@ void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk if ((t=libconfig->setting_get_member(conf, "Element")) && config_setting_is_group(t)) { int j = 0; - char lv[5]; + char lv[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL for (j=0; j < MAX_SKILL_LEVEL; j++) { sprintf(lv, "Lv%d",j+1); 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) |