Prevent entity from leaving the map bounds.

This commit is contained in:
Steve 2018-02-09 22:34:30 +00:00
parent 972c3c4aa9
commit 32109cbc15
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}