diff options
author | skyleo <skyleo@skyleo.de> | 2019-09-08 02:53:24 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-03-08 20:56:27 +0100 |
commit | d13b24a62ac933364839c7ece1f70eba001e7c2d (patch) | |
tree | c10d9f953cf017579a22c9d58b9fc74fefc2956e /src/map/unit.h | |
parent | feb1f9d96a9cfc12602c96235106397b67f2aeb4 (diff) | |
download | hercules-d13b24a62ac933364839c7ece1f70eba001e7c2d.tar.gz hercules-d13b24a62ac933364839c7ece1f70eba001e7c2d.tar.bz2 hercules-d13b24a62ac933364839c7ece1f70eba001e7c2d.tar.xz hercules-d13b24a62ac933364839c7ece1f70eba001e7c2d.zip |
Refactor code using directions to use enum unit_dir
This removes a lot of duplicated code, especially related to people not using the arrays dirx and diry.
Assertions for whenever these arrays are used have been added as well, to ensure valid index range.
Some trailing white space has been removed as well.
Diffstat (limited to 'src/map/unit.h')
-rw-r--r-- | src/map/unit.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/unit.h b/src/map/unit.h index bdee032f8..7c9dc1095 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -139,7 +139,7 @@ struct unit_interface { int (*cancel_combo) (struct block_list *bl); bool (*can_reach_pos) (struct block_list *bl, int x, int y, int easy); bool (*can_reach_bl) (struct block_list *bl, struct block_list *tbl, int range, int easy, short *x, short *y); - int (*calc_pos) (struct block_list *bl, int tx, int ty, uint8 dir); + int (*calc_pos) (struct block_list *bl, int tx, int ty, enum unit_dir dir); int (*attack_timer_sub) (struct block_list *src, int tid, int64 tick); int (*skillcastcancel) (struct block_list *bl, int type); void (*dataset) (struct block_list *bl); |