From b5dcf358a036ef024807b4060b48bb4a30967742 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Thu, 14 May 2020 23:31:12 +0200 Subject: Replace NULL pointer report with returning error code in unit_steptimer() --- src/map/unit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/unit.c b/src/map/unit.c index 19f09f83c..3965be852 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -270,9 +270,8 @@ static int unit_steptimer(int tid, int64 tick, int id, intptr_t data) } else { // If a player has target_id set and target is in range, attempt attack struct block_list *tbl = map->id2bl(target_id); - nullpo_retr(2, tbl); - if (status->check_visibility(bl, tbl) == 0) // Target not visible - return 1; + if (tbl == NULL || status->check_visibility(bl, tbl) == 0) + return 1; // Target does not exist (player offline, monster died, etc.) or target is not visible to source. if (ud->stepskill_id == 0) unit->attack(bl, tbl->id, ud->state.attack_continue + 2); // Execute normal attack else -- cgit v1.2.3-60-g2f50