Fixed dead monsters stuck after killed (#5263)

This commit is contained in:
Daegaladh
2022-05-20 13:27:26 +02:00
committed by GitHub
parent 667645c2e2
commit fa363b972d
3 changed files with 7 additions and 1 deletions

View File

@@ -811,7 +811,7 @@ static TIMER_FUNC(unit_walktobl_sub){
struct block_list *bl = map_id2bl(id);
struct unit_data *ud = bl?unit_bl2ud(bl):NULL;
if (ud && ud->walktimer == INVALID_TIMER && ud->target == data) {
if (ud && ud->walktimer == INVALID_TIMER && ud->target && ud->target == data) {
if (DIFF_TICK(ud->canmove_tick, tick) > 0) // Keep waiting?
add_timer(ud->canmove_tick+1, unit_walktobl_sub, id, data);
else if (unit_can_move(bl)) {
@@ -3041,6 +3041,9 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
if (ud->walktimer != INVALID_TIMER)
unit_stop_walking(bl,0);
if (clrtype == CLR_DEAD)
ud->state.blockedmove = true;
if (ud->skilltimer != INVALID_TIMER)
unit_skillcastcancel(bl,0);