summaryrefslogtreecommitdiff
path: root/src/map/unit.h
diff options
context:
space:
mode:
authorskyleo <skyleo@skyleo.de>2019-09-08 02:42:37 +0200
committerHaru <haru@dotalux.com>2020-03-08 20:56:27 +0100
commitfeb1f9d96a9cfc12602c96235106397b67f2aeb4 (patch)
tree570d9f98fb30157e64b27928c72ff78d85dc4f52 /src/map/unit.h
parentfe378985d5267bee1f73049c826ad4f1e9c2b9c4 (diff)
downloadhercules-feb1f9d96a9cfc12602c96235106397b67f2aeb4.tar.gz
hercules-feb1f9d96a9cfc12602c96235106397b67f2aeb4.tar.bz2
hercules-feb1f9d96a9cfc12602c96235106397b67f2aeb4.tar.xz
hercules-feb1f9d96a9cfc12602c96235106397b67f2aeb4.zip
Add enum unit_dir and make direction functions use it
Without a doubt the readability of code will be increased by this greatly
Diffstat (limited to 'src/map/unit.h')
-rw-r--r--src/map/unit.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/unit.h b/src/map/unit.h
index 315cc0515..bdee032f8 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -24,6 +24,7 @@
#include "map/clif.h" // clr_type
#include "map/path.h" // struct walkpath_data
#include "map/skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
+#include "map/unitdefines.h" // enum unit_dir
#include "common/hercules.h"
struct map_session_data;
@@ -67,7 +68,7 @@ struct unit_data {
int64 attackabletime;
int64 canact_tick;
int64 canmove_tick;
- uint8 dir;
+ enum unit_dir dir;
unsigned char walk_count;
unsigned char target_count;
struct {
@@ -115,8 +116,8 @@ struct unit_interface {
void (*run_hit) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type);
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 (*setdir) (struct block_list *bl, unsigned char dir);
- uint8 (*getdir) (struct block_list *bl);
+ int (*setdir) (struct block_list *bl, enum unit_dir dir);
+ enum unit_dir (*getdir) (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);