diff options
author | skyleo <skyleo@skyleo.de> | 2019-12-02 19:03:05 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-03-08 20:59:35 +0100 |
commit | d21fd8e6727f1fba7cb57994aa9c74d4dd0cf05b (patch) | |
tree | 166dee43ef13596e16a7f136563e27232e854302 /src/map | |
parent | 2a6299822436e560319fd288dc44d8997943e731 (diff) | |
download | hercules-d21fd8e6727f1fba7cb57994aa9c74d4dd0cf05b.tar.gz hercules-d21fd8e6727f1fba7cb57994aa9c74d4dd0cf05b.tar.bz2 hercules-d21fd8e6727f1fba7cb57994aa9c74d4dd0cf05b.tar.xz hercules-d21fd8e6727f1fba7cb57994aa9c74d4dd0cf05b.zip |
Change bl parameter to be const in unit->getdir
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/unit.c | 4 | ||||
-rw-r--r-- | src/map/unit.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 28f81017f..4a0d98cc4 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -937,13 +937,13 @@ static int unit_set_dir(struct block_list *bl, enum unit_dir dir) * @param bl: unit to request data from * @return the facing direction @see enum unit_dir */ -static enum unit_dir unit_getdir(struct block_list *bl) +static enum unit_dir unit_getdir(const struct block_list *bl) { nullpo_retr(UNIT_DIR_NORTH, bl); if (bl->type == BL_NPC) return BL_UCCAST(BL_NPC, bl)->dir; - struct unit_data *ud = unit->bl2ud(bl); + const struct unit_data *ud = unit->cbl2ud(bl); if (ud == NULL) return UNIT_DIR_NORTH; return ud->dir; diff --git a/src/map/unit.h b/src/map/unit.h index 7bf94d3e1..3f288e0d3 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -118,7 +118,7 @@ struct unit_interface { int (*escape) (struct block_list *bl, struct block_list *target, short dist); int (*movepos) (struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath); int (*set_dir) (struct block_list *bl, enum unit_dir dir); - enum unit_dir (*getdir) (struct block_list *bl); + enum unit_dir (*getdir) (const struct block_list *bl); int (*blown) (struct block_list *bl, int dx, int dy, int count, int flag); int (*warp) (struct block_list *bl, short m, short x, short y, enum clr_type type); int (*warpto_master) (struct block_list *master_bl, struct block_list *slave_bl); |