Test
This commit is contained in:
@@ -117,6 +117,8 @@ command(struct rogue_state *rs)
|
|||||||
* turn off count for commands which don't make sense
|
* turn off count for commands which don't make sense
|
||||||
* to repeat
|
* to repeat
|
||||||
*/
|
*/
|
||||||
|
if ( rs->guiflag == 0 && rs->replaydone != 0 )
|
||||||
|
ch = 'Q';
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case CTRL('B'): case CTRL('H'): case CTRL('J'):
|
case CTRL('B'): case CTRL('H'): case CTRL('J'):
|
||||||
|
|||||||
@@ -157,14 +157,14 @@ readchar(struct rogue_state *rs)
|
|||||||
{
|
{
|
||||||
if ( rs->ind < rs->numkeys )
|
if ( rs->ind < rs->numkeys )
|
||||||
{
|
{
|
||||||
if ( rs->ind == rs->numkeys-1 )
|
//if ( rs->ind == rs->numkeys-1 )
|
||||||
rs->replaydone = (uint32_t)time(NULL);
|
// rs->replaydone = (uint32_t)time(NULL);
|
||||||
fprintf(stderr,"(%c) ",rs->keystrokes[rs->ind]);
|
fprintf(stderr,"(%c) ",rs->keystrokes[rs->ind]);
|
||||||
return(rs->keystrokes[rs->ind++]);
|
return(rs->keystrokes[rs->ind++]);
|
||||||
}
|
}
|
||||||
fprintf(stderr,"replay finished but readchar called\n");
|
fprintf(stderr,"replay finished but readchar called\n");
|
||||||
rs->replaydone = (uint32_t)time(NULL);
|
rs->replaydone = (uint32_t)time(NULL);
|
||||||
return(ESCAPE);
|
return('y');
|
||||||
}
|
}
|
||||||
if ( rs == 0 || rs->guiflag != 0 )
|
if ( rs == 0 || rs->guiflag != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -571,27 +571,37 @@ quit(int sig)
|
|||||||
{
|
{
|
||||||
struct rogue_state *rs = &globalR;
|
struct rogue_state *rs = &globalR;
|
||||||
int oy, ox;
|
int oy, ox;
|
||||||
|
fprintf(stder,"inside quit(%d)\n",sig);
|
||||||
|
if ( rs->guiflag != 0 )
|
||||||
|
{
|
||||||
|
NOOP(sig);
|
||||||
|
|
||||||
NOOP(sig);
|
/*
|
||||||
|
* Reset the signal in case we got here via an interrupt
|
||||||
/*
|
*/
|
||||||
* Reset the signal in case we got here via an interrupt
|
if (!q_comm)
|
||||||
*/
|
mpos = 0;
|
||||||
if (!q_comm)
|
getyx(curscr, oy, ox);
|
||||||
mpos = 0;
|
msg(rs,"really quit?");
|
||||||
getyx(curscr, oy, ox);
|
}
|
||||||
msg(rs,"really quit?");
|
|
||||||
if (readchar(rs) == 'y')
|
if (readchar(rs) == 'y')
|
||||||
{
|
{
|
||||||
signal(SIGINT, leave);
|
if ( rs->guiflag != 0 )
|
||||||
clear();
|
{
|
||||||
mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse);
|
signal(SIGINT, leave);
|
||||||
move(LINES - 1, 0);
|
clear();
|
||||||
if ( rs->sleeptime != 0 )
|
mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse);
|
||||||
refresh();
|
move(LINES - 1, 0);
|
||||||
score(purse, 1, 0);
|
if ( rs->sleeptime != 0 )
|
||||||
flushkeystrokes(rs);
|
refresh();
|
||||||
my_exit(0);
|
score(purse, 1, 0);
|
||||||
|
flushkeystrokes(rs);
|
||||||
|
my_exit(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
score(purse, 1, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user