This commit is contained in:
jl777
2019-02-17 22:29:58 -11:00
parent f513e5d1f5
commit ef4844d5a3
4 changed files with 29 additions and 18 deletions

View File

@@ -264,7 +264,7 @@ over:
when 'Q': when 'Q':
after = FALSE; after = FALSE;
q_comm = TRUE; q_comm = TRUE;
if ( quit(0) > 0 ) if ( _quit() > 0 )
{ {
if ( rs->guiflag != 0 ) if ( rs->guiflag != 0 )
{ {

View File

@@ -141,7 +141,8 @@ void getltchars(void);
void leave(int); void leave(int);
void my_exit(int st); void my_exit(int st);
void playltchars(void); void playltchars(void);
int32_t quit(int); void quit(int);
int32_t _quit();
void resetltchars(void); void resetltchars(void);
void set_order(int *order, int numthings); void set_order(int *order, int numthings);
void tstp(int ignored); void tstp(int ignored);

View File

@@ -174,7 +174,7 @@ readchar(struct rogue_state *rs)
if (ch == 3) if (ch == 3)
{ {
quit(0); _quit();
return(27); return(27);
} }
if ( rs != 0 && rs->guiflag != 0 ) if ( rs != 0 && rs->guiflag != 0 )

View File

@@ -613,26 +613,13 @@ playit(struct rogue_state *rs)
endit(0); endit(0);
} }
/*
* quit:
* Have player make certain, then exit.
*/
int32_t quit(int sig)
int32_t _quit()
{ {
struct rogue_state *rs = &globalR; struct rogue_state *rs = &globalR;
int oy, ox, c; int oy, ox, c;
//fprintf(stderr,"inside quit(%d)\n",sig); //fprintf(stderr,"inside quit(%d)\n",sig);
if ( rs->guiflag != 0 )
{
NOOP(sig);
/*
* Reset the signal in case we got here via an interrupt
*/
if (!q_comm)
mpos = 0;
}
getyx(curscr, oy, ox); getyx(curscr, oy, ox);
msg(rs,"really quit?"); msg(rs,"really quit?");
sleep(1); sleep(1);
@@ -673,6 +660,29 @@ int32_t quit(int sig)
} }
} }
/*
* quit:
* Have player make certain, then exit.
*/
void quit(int sig)
{
struct rogue_state *rs = &globalR;
int oy, ox, c;
//fprintf(stderr,"inside quit(%d)\n",sig);
if ( rs->guiflag != 0 )
{
NOOP(sig);
/*
* Reset the signal in case we got here via an interrupt
*/
if (!q_comm)
mpos = 0;
}
_quit();
}
/* /*
* leave: * leave:
* Leave quickly, but curteously * Leave quickly, but curteously