diff options
author | Haru <haru@dotalux.com> | 2020-06-01 02:46:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 02:46:12 +0200 |
commit | 183488e0088f59242b0ab609271d126dc2a6c758 (patch) | |
tree | 7cbcefd162a683bd083f556ea11d75369999bc85 /src/map/unit.c | |
parent | 0a2097d8e295a329ad3d0e732fb74e77707dc2bb (diff) | |
parent | 560b765a844c453ce2c7cff24a63735f11dc4f0f (diff) | |
download | hercules-183488e0088f59242b0ab609271d126dc2a6c758.tar.gz hercules-183488e0088f59242b0ab609271d126dc2a6c758.tar.bz2 hercules-183488e0088f59242b0ab609271d126dc2a6c758.tar.xz hercules-183488e0088f59242b0ab609271d126dc2a6c758.zip |
Merge pull request #2731 from Kenpachi2k13/skill_db_update
Extend and clean up skill DB code
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 53e517045..a6afb5ee7 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1152,7 +1152,7 @@ static int unit_stop_walking(struct block_list *bl, int flag) static int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv) { int casttime = skill->cast_fix(src, skill_id, skill_lv); - int castcancel = skill->get_castcancel(skill_id); + int castcancel = skill->get_castcancel(skill_id, skill_lv); int ret = unit->skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel); struct map_session_data *sd = BL_CAST(BL_PC, src); @@ -1567,7 +1567,7 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill //Check range when not using skill on yourself or is a combo-skill during attack //(these are supposed to always have the same range as your attack) if( src->id != target_id && (!temp || ud->attacktimer == INVALID_TIMER) ) { - if( skill->get_state(ud->skill_id) == ST_MOVE_ENABLE ) { + if (skill->get_state(ud->skill_id, ud->skill_lv) == ST_MOVE_ENABLE) { if( !unit->can_reach_bl(src, target, range + 1, 1, NULL, NULL) ) return 0; // Walk-path check failed. } else if( src->type == BL_MER && skill_id == MA_REMOVETRAP ) { @@ -1790,7 +1790,7 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill static int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv) { int casttime = skill->cast_fix(src, skill_id, skill_lv); - int castcancel = skill->get_castcancel(skill_id); + int castcancel = skill->get_castcancel(skill_id, skill_lv); int ret = unit->skilluse_pos2(src, skill_x, skill_y, skill_id, skill_lv, casttime, castcancel); struct map_session_data *sd = BL_CAST(BL_PC, src); @@ -1872,7 +1872,7 @@ static int unit_skilluse_pos2(struct block_list *src, short skill_x, short skill return 0; // Attacking will be handled by unit_walk_toxy_timer in this case } - if( skill->get_state(ud->skill_id) == ST_MOVE_ENABLE ) { + if (skill->get_state(ud->skill_id, ud->skill_lv) == ST_MOVE_ENABLE) { if( !unit->can_reach_bl(src, &bl, range + 1, 1, NULL, NULL) ) return 0; //Walk-path check failed. } else if( !battle->check_range(src, &bl, range) ) |