diff --git a/src/map.cpp b/src/map.cpp index 0e2d34b..a8da898 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -29,7 +29,7 @@ void Map::block(uint8_t x, uint8_t y, Block *b) { Block *Map::block_under(Event *e) { if (!e) { return NULL; } - uint16_t bx = e->event_x() / 2, by = e->event_y() / 2; + int16_t bx = e->event_x() / 2, by = e->event_y() / 2; return bx >= 0 && by >= 0 && bx < _width && by < _height ? block((uint8_t)bx, (uint8_t)by) : NULL; }