diff --git a/game/main.c b/game/main.c index 2138c50..2370fc1 100644 --- a/game/main.c +++ b/game/main.c @@ -409,11 +409,14 @@ static void entityupdate(gamestate_t *state, entity_t *e, double dt) const dvec_t pfb = { .x = nextx + e->fbox.off.x, .y = nexty + e->fbox.off.y }; bool valid = true; - valid &= tilepassable(state->map, pfb.x, pfb.y); - valid &= tilepassable(state->map, pfb.x + e->fbox.ext.x, pfb.y); - valid &= tilepassable(state->map, pfb.x, pfb.y + e->fbox.ext.y); + valid &= tilepassable(state->map, (int)rint(pfb.x), (int)rint(pfb.y)); valid &= tilepassable( - state->map, pfb.x + e->fbox.ext.x, pfb.y + e->fbox.ext.y); + state->map, (int)rint(pfb.x + e->fbox.ext.x), (int)rint(pfb.y)); + valid &= tilepassable( + state->map, (int)rint(pfb.x), (int)rint(pfb.y + e->fbox.ext.y)); + valid &= tilepassable( + state->map, (int)rint(pfb.x + e->fbox.ext.x), + (int)rint(pfb.y + e->fbox.ext.y)); if (valid) { e->pos.x = nextx; e->pos.y = nexty;