X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fserver%2Fmap.c;fp=src%2Fserver%2Fmap.c;h=50c7bf1560105c5e6b3f2af12971637492ae2ac5;hb=6db8d212ad66a7a934a47f319f88d1c811791798;hp=8ed37d9b50cbd017baf0cb2c0464e5e547aebeab;hpb=bc117a9e8e2d69fcad8c8955ae8237b3476bf67b;p=plomrogue diff --git a/src/server/map.c b/src/server/map.c index 8ed37d9..50c7bf1 100644 --- a/src/server/map.c +++ b/src/server/map.c @@ -7,6 +7,7 @@ #include "../common/try_malloc.h" /* try_malloc() */ #include "../common/yx_uint8.h" /* struct yx_uint8 */ #include "rrand.h" /* rrand() */ +#include "yx_uint8.h" /* mv_yx_in_dir_wrap() */ #include "world.h" /* global world */ @@ -160,3 +161,15 @@ extern uint8_t is_passable(struct yx_uint8 pos) } return passable; } + + + +extern uint8_t mv_yx_in_dir_legal(char dir, struct yx_uint8 * yx) +{ + uint8_t wraptest = mv_yx_in_dir_wrap(dir, yx, 0); + if (!wraptest && yx->x < world.map.length && yx->y < world.map.length) + { + return 1; + } + return 0; +}