* Fix #2694

Move down skill_unit_move(bl,gettick(),4) of unit_remove_map_ to avoid conflict with duel changing realm.
The issue was that skill_unit_onleft was called before the duel_leave handling which was reapplying skill_unit_onplace causing an infinite status duration.
Other skill might had same issue.

* Small optimisation.
Avoid calling status_change_end when we have no status set yet (or no status_change holder).
Move down overrecurent call to status_change_end SC_ROLLINGCUTTER.
This commit is contained in:
lighta
2017-12-22 14:29:44 -05:00
committed by GitHub
parent 65771a8ec1
commit 5ad35eb66b
3 changed files with 29 additions and 23 deletions

View File

@@ -406,7 +406,6 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
y += dy;
map_moveblock(bl, x, y, tick);
ud->walk_count++; // Walked cell counter, to be used for walk-triggered skills. [Skotlex]
status_change_end(bl, SC_ROLLINGCUTTER, INVALID_TIMER); // If you move, you lose your counters. [malufett]
if (bl->x != x || bl->y != y || ud->walktimer != INVALID_TIMER)
return 0; // map_moveblock has altered the object beyond what we expected (moved/warped it)
@@ -2878,11 +2877,6 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
status_change_end(bl, SC_SUHIDE, INVALID_TIMER);
}
if (bl->type&(BL_CHAR|BL_PET)) {
skill_unit_move(bl,gettick(),4);
skill_cleartimerskill(bl);
}
switch( bl->type ) {
case BL_PC: {
struct map_session_data *sd = (struct map_session_data*)bl;
@@ -3066,6 +3060,10 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
break;// do nothing
}
if (bl->type&(BL_CHAR|BL_PET)) {
skill_unit_move(bl,gettick(),4);
skill_cleartimerskill(bl);
}
// /BL_MOB is handled by mob_dead unless the monster is not dead.
if( bl->type != BL_MOB || !status_isdead(bl) )
clif_clearunit_area(bl,clrtype);