X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fmap.c;h=1615818ba329c792f62cf4c057bc1d5f8bb4f8fa;hb=2dccba703435158681552b8a8aefccab79eb13f3;hp=45cd2e15ceadeb3fc0f3e9c27ceeea5ec5ade9ae;hpb=42f6cd9789e06f0257a078a33fa13aaea0714fce;p=plomrogue diff --git a/src/map.c b/src/map.c index 45cd2e1..1615818 100644 --- a/src/map.c +++ b/src/map.c @@ -97,3 +97,15 @@ extern void map_center() struct Win * win_map = get_win_by_id('m'); win_map->center = player->pos; } + + + +extern uint8_t is_passable(struct Map * map, struct yx_uint16 pos) +{ + uint8_t passable = 0; + if (0 <= pos.x && pos.x < map->size.x && 0 <= pos.y && pos.y < map->size.y) + { + passable = (('.' == map->cells[pos.y * map->size.x + pos.x])); + } + return passable; +}