From 584b0ab045ada71cac26e41f05daf7bd0e23f15d Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sat, 8 Oct 2011 14:02:51 +0800 Subject: [PATCH] --- scene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene.c b/scene.c index e6dee1f..b78e2af 100644 --- a/scene.c +++ b/scene.c @@ -276,14 +276,14 @@ void makeMenu() { addObjectSubmenu[i] = glutCreateMenu(processObjectEvents); int startNum = i*11 - (i-1); for ( int j = startNum - 1; j < (startNum+9); j++ ) { - if ( j + 1 == objectMenuEntriesSize ) break; // Detect if we've reached the end of the array + if ( j == objectMenuEntriesSize ) break; // Detect if we've reached the end of the array glutAddMenuEntry( objectMenuEntries[j], j ); } } // Construct add object menu int addObjectMenu = glutCreateMenu(processObjectEvents); - for ( int i = 0; addObjectSubmenu[i]; i++ ) { + for ( int i = 0; i < menuNumber - 1; i++ ) { char name[10]; // buffer to hold name int startNum = i*11 - (i-1); sprintf(name, "%d-%d", startNum, startNum + 9); -- 2.20.1