From 8f1d0a474a74b166e302046fa47f91450ba05598 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 21 Mar 2020 22:14:24 +0100 Subject: Cured floating point exception --- src/ft_draw_life_bar.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ft_draw_life_bar.c') diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index 25d5ebe..64d1f1f 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -92,6 +92,7 @@ static void int16_t y; const int16_t scl = cl->mlist.scale; + x = ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4); y = cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; while (y < (int16_t)(cl->wlist.y_size - 10)) { @@ -102,6 +103,8 @@ static void } y -= cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; x -= ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4); + y = (y == 0) ? (1) : (y); + x = (x == 0) ? (1) : (x); cl->h = y; cl->w = x; } -- cgit v1.2.3