From 40e0422b8754dc5b0f57b2dd5c5892798a598c22 Mon Sep 17 00:00:00 2001 From: skyleo Date: Wed, 11 Sep 2019 21:55:37 +0200 Subject: Cleanup nullpointer checks in unit->walktoxy --- src/map/unit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/unit.c b/src/map/unit.c index f5784b405..61a85d431 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -529,7 +529,8 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag) ud = unit->bl2ud(bl); - if( ud == NULL) return 0; + if (ud == NULL) + return 0; if (battle_config.check_occupied_cells && (flag&8) && !map->closest_freecell(bl->m, bl, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y return 0; @@ -564,7 +565,7 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag) unit->stop_stepaction(bl); // unit->walktoxy removes any remembered stepaction and resets ud->target_to sc = status->get_sc(bl); - if( sc ) { + if (sc != NULL) { if( sc->data[SC_CONFUSION] || sc->data[SC__CHAOS] ) //Randomize the target position map->random_dir(bl, &ud->to_x, &ud->to_y); if( sc->data[SC_COMBOATTACK] ) -- cgit v1.2.3-60-g2f50