summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-02 05:31:57 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-02 05:31:57 +0200
commit452dd304e008c4844ff2e923ff16a6f540ffe87d (patch)
tree5d36baa0ce1fad852f3a2c7002c48823e1d35760 /src/map
parent3635ef96887de748ac053e1ebd51f0deed7f9b6c (diff)
downloadhercules-452dd304e008c4844ff2e923ff16a6f540ffe87d.tar.gz
hercules-452dd304e008c4844ff2e923ff16a6f540ffe87d.tar.bz2
hercules-452dd304e008c4844ff2e923ff16a6f540ffe87d.tar.xz
hercules-452dd304e008c4844ff2e923ff16a6f540ffe87d.zip
Don't use unit's skill data before it's set in unit_skilluse_id2() and unit_skilluse_pos2()
Diffstat (limited to 'src/map')
-rw-r--r--src/map/unit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index c23e96aee..fb6d992ae 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1566,7 +1566,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, ud->skill_lv) == ST_MOVE_ENABLE) {
+ if (skill->get_state(skill_id, 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 ) {
@@ -1871,7 +1871,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, ud->skill_lv) == ST_MOVE_ENABLE) {
+ if (skill->get_state(skill_id, 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) )