From 32109cbc150b7a64a54828a41517bace5ea955c6 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 9 Feb 2018 22:34:30 +0000 Subject: [PATCH] Prevent entity from leaving the map bounds. --- src/world/entities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/entities.c b/src/world/entities.c index 600860f..a5e9fbd 100644 --- a/src/world/entities.c +++ b/src/world/entities.c @@ -398,7 +398,7 @@ static void moveEntity(void) if (!(self->flags & (EF_KILL_OFFSCREEN | EF_NO_CLIP))) { self->x = limit(self->x, world.map.bounds.x, world.map.bounds.w + SCREEN_WIDTH - self->w); - self->y = limit(self->y, world.map.bounds.y - 64, world.map.bounds.h + SCREEN_HEIGHT - self->h); + self->y = limit(self->y, world.map.bounds.y, world.map.bounds.h + SCREEN_HEIGHT - self->h); } }