Browse Source

Fix off-by-one in collision logic

master
Forest Belton 2 years ago
parent
commit
a3d869212c
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/collision.c

+ 1
- 2
src/collision.c View File

@ -9,8 +9,7 @@ typedef enum {
} coll_state_t;
uint8_t can_move_to(uint8_t x, uint8_t y) {
const uint8_t coll =
((uint8_t*)MAP.collision_ptr)[y * (MAP.map_width + 1) + x];
const uint8_t coll = ((uint8_t*)MAP.collision_ptr)[y * MAP.map_width + x];
return coll & COLLF_WALK;
}

Loading…
Cancel
Save