From: Ash Tyndall Date: Sat, 8 Oct 2011 06:05:24 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=4a6c501688b7fbd4f46e61aab76611499819e347;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index 882b7cc..c7d5318 100644 --- a/scene.c +++ b/scene.c @@ -286,7 +286,11 @@ void makeMenu() { for ( int i = 0; i < menuNumber; i++ ) { char name[10]; // buffer to hold name int startNum = i*11 - (i-1); - sprintf(name, "%d-%d", startNum, startNum + 9); + int endNum = startNum + 9; + if ( i == menuNumber - 1 ) { // We're on the last one + endNum = startNum + 4; + } + sprintf(name, "%d-%d", startNum, endNum); glutAddSubMenu( name, addObjectSubmenu[i] ); }