diff options
author | skyleo <skyleo@skyleo.de> | 2019-09-11 21:55:37 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-03-08 20:56:28 +0100 |
commit | 40e0422b8754dc5b0f57b2dd5c5892798a598c22 (patch) | |
tree | 3129fcc70c0752becad886bea3daf659124efc4f /src/map/unit.c | |
parent | 769f5801f3499f525071cd0363ca9e66ef46f2cf (diff) | |
download | hercules-40e0422b8754dc5b0f57b2dd5c5892798a598c22.tar.gz hercules-40e0422b8754dc5b0f57b2dd5c5892798a598c22.tar.bz2 hercules-40e0422b8754dc5b0f57b2dd5c5892798a598c22.tar.xz hercules-40e0422b8754dc5b0f57b2dd5c5892798a598c22.zip |
Cleanup nullpointer checks in unit->walktoxy
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 5 |
1 files changed, 3 insertions, 2 deletions
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] ) |