]> git.sur5r.net Git - c128-kasse/commitdiff
Bugfix: Use CREDITS_PER_PAGE
authorsECuRE <sECuRE@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Sun, 30 Nov 2008 11:13:15 +0000 (11:13 +0000)
committersECuRE <sECuRE@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Sun, 30 Nov 2008 11:13:15 +0000 (11:13 +0000)
git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@88 af93e077-1a23-4f1e-9cbe-9382a9d578f5

include/config.h
src/credit_manager.c

index 18cbb11e5791fd8c09c4e49174888acecca57fd8..fb2fd1bc613fe700d5ed02ad5c3388c6f2f0fc09 100644 (file)
@@ -6,6 +6,7 @@
 #define MAX_ITEMS 16
 #define MAX_ITEM_NAME_LENGTH 9
 #define MAX_CREDIT_ITEMS 75
+#define CREDITS_PER_PAGE 10
 
 /* Eingenommes Geld in Cent */
 extern unsigned long int money;
index 29fdac6dbbbd062bcf3834fb629d41233f8da2df..05073dc2bd7fb62a3f0f555ef0ad0e8125a4f979 100644 (file)
@@ -23,12 +23,11 @@ static void credit_print_screen() {
 
        clrscr();
        cprintf("itemz (phil_fry, sECuRE, sur5r)\r\n\r\n");
-       /* 16 entries per page */
-       pages = (credits.num_items / 10);
+       pages = (credits.num_items / CREDITS_PER_PAGE);
        if (current_credits_page > pages)
                current_credits_page = pages;
        cprintf("Datei: CREDITS (Seite %d von %d)\r\n\r\n", current_credits_page, pages);
-       for (i = (current_credits_page * 10); i < credits.num_items && i < ((current_credits_page+1) * 10); i++) {
+       for (i = (current_credits_page * CREDITS_PER_PAGE); i < credits.num_items && i < ((current_credits_page+1) * CREDITS_PER_PAGE); i++) {
                if (filter == NULL || strncmp(credits.credits[i].nickname, filter, filter_len) == 0) {
                        if (format_euro(buffer, 10, credits.credits[i].credit) != buffer) {
                                cprintf("Error: Could not format credit %d\r\n", credits.credits[i].credit);
@@ -144,7 +143,7 @@ void credit_manager(){
                        case 's':
                                save_credits(); break;
                        case 'f':
-                               if (current_credits_page < (credits.num_items / 16))
+                               if (current_credits_page < (credits.num_items / CREDITS_PER_PAGE))
                                                current_credits_page++;
                                break;
                        case 'b':