diff options
author | csnv <ctt@csnv.es> | 2015-01-03 20:28:09 +0100 |
---|---|---|
committer | csnv <ctt@csnv.es> | 2015-01-03 20:28:09 +0100 |
commit | 0cd471b3e4ec92c94e960de4fd5c2a19ad0ee2f9 (patch) | |
tree | d613da23a2d5dbc02469f5e05d2f2d937d904349 | |
parent | 50aae2224eb784aeaec46537574cc5c5bafc8c3e (diff) | |
download | hercules-0cd471b3e4ec92c94e960de4fd5c2a19ad0ee2f9.tar.gz hercules-0cd471b3e4ec92c94e960de4fd5c2a19ad0ee2f9.tar.bz2 hercules-0cd471b3e4ec92c94e960de4fd5c2a19ad0ee2f9.tar.xz hercules-0cd471b3e4ec92c94e960de4fd5c2a19ad0ee2f9.zip |
Fixes the direction of an object (char, mob, etc) when it faces a target after an action (skill, attack)
-rw-r--r-- | src/map/skill.c | 5 | ||||
-rw-r--r-- | src/map/unit.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 423bcf630..34689bd9d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5008,6 +5008,9 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { else ud->skill_id = 0; //mobs can't clear this one as it is used for skill condition 'afterskill' ud->skill_lv = ud->skilltarget = 0; } + + unit->setdir(src, map->calc_dir(src, target->x, target->y)); + map->freeblock_unlock(); return 1; } while(0); @@ -9843,6 +9846,8 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) { ud->skill_lv = ud->skillx = ud->skilly = 0; } + unit->setdir(src, map->calc_dir(src, ud->skillx, ud->skilly)); + map->freeblock_unlock(); return 1; } while(0); diff --git a/src/map/unit.c b/src/map/unit.c index deb061f78..7f41f4709 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1599,6 +1599,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui ud->skill_lv = skill_lv; if( casttime > 0 ) { + if (src->id != target->id) // self-targeted skills shouldn't show different direction + unit->setdir(src, map->calc_dir(src, target->x, target->y)); ud->skilltimer = timer->add( tick+casttime, skill->castend_id, src->id, 0 ); if( sd && (pc->checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) ) status_calc_bl(&sd->bl, SCB_SPEED); @@ -1742,6 +1744,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui // in official this is triggered even if no cast time. clif->skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime); if( casttime > 0 ) { + unit->setdir(src, map->calc_dir(src, skill_x, skill_y)); ud->skilltimer = timer->add( tick+casttime, skill->castend_pos, src->id, 0 ); if( (sd && pc->checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK) status_calc_bl(&sd->bl, SCB_SPEED); @@ -2170,6 +2173,7 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) { } if(ud->state.attack_continue) { + unit->setdir(src, map->calc_dir(src, target->x, target->y)); if( src->type == BL_PC && battle_config.idletime_criteria & BCIDLE_ATTACK ) ((TBL_PC*)src)->idletime = sockt->last_tick; ud->attacktimer = timer->add(ud->attackabletime,unit->attack_timer,src->id,0); |