From e27c60156eeb5ce8fb5f7e3112e8928e8a42e3a4 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 6 May 2016 12:44:36 +0100 Subject: [PATCH] Misc. code clean up. --- src/game/trophies.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/trophies.c b/src/game/trophies.c index 3759bfc..4ec434a 100644 --- a/src/game/trophies.c +++ b/src/game/trophies.c @@ -132,7 +132,7 @@ void drawTrophies(void) { Trophy *t; SDL_Rect r; - int start, i, x, y; + int start, end, i, x, y; SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND); SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128); @@ -159,11 +159,12 @@ void drawTrophies(void) x = r.x + 15; y = 180; start = page * TROPHIES_PER_PAGE; + end = start + TROPHIES_PER_PAGE; i = 0; for (t = game.trophyHead.next ; t != NULL ; t = t->next) { - if (i >= start && i < start + TROPHIES_PER_PAGE) + if (i >= start && i < end) { if (t->awarded) {