Fix a bug where users couldn't exit from dgl. Found by blindcoder.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@449 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2008-08-23 12:39:01 +00:00
parent dfc4cc51d1
commit 715108f70d
2 changed files with 7 additions and 6 deletions

View File

@ -1717,14 +1717,14 @@ purge_stale_locks (int game)
}
void
int
runmenuloop(struct dg_menu *menu)
{
struct dg_banner ban;
struct dg_menuoption *tmpopt;
int userchoice = 0;
if (!menu) return;
if (!menu) return 1;
ban.lines = NULL;
ban.len = 0;
@ -1736,7 +1736,7 @@ runmenuloop(struct dg_menu *menu)
mvprintw(menu->cursor_y, menu->cursor_x, "");
refresh();
userchoice = getch();
if (userchoice == ERR) return;
if (userchoice == ERR) return 1;
tmpopt = menu->options;
while (tmpopt) {
if (strchr(tmpopt->keys, userchoice)) {
@ -1749,7 +1749,7 @@ runmenuloop(struct dg_menu *menu)
if (return_from_submenu) {
return_from_submenu = 0;
return;
return 0;
}
if (check_retard(0)) {
@ -2004,7 +2004,8 @@ main (int argc, char** argv)
initcurses ();
while (1) {
runmenuloop(dgl_find_menu(loggedin ? "mainmenu_user" : "mainmenu_anon"));
if (runmenuloop(dgl_find_menu(loggedin ? "mainmenu_user" : "mainmenu_anon")))
break;
}
/* NOW we can safely kill this */

View File

@ -191,7 +191,7 @@ extern struct dg_game **populate_games(int game, int *l);
extern struct dg_game **sort_games(struct dg_game **games, int len, dg_sortmode sortmode);
void runmenuloop(struct dg_menu *menu);
int runmenuloop(struct dg_menu *menu);
extern void inprogressmenu(int gameid);
extern void change_email(void);