Make REDO unconditional.
This commit is contained in:
@@ -417,16 +417,13 @@ typedef unsigned char uchar;
|
||||
#define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */
|
||||
/* monsters & objects */
|
||||
/* I/O */
|
||||
#define REDO /* support for redoing last command - DGK */
|
||||
#if !defined(MAC)
|
||||
# if !defined(NOCLIPPING)
|
||||
# define CLIPPING /* allow smaller screens -- ERS */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef REDO
|
||||
# define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
|
||||
#endif
|
||||
#define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
|
||||
|
||||
#define EXP_ON_BOTL /* Show experience on bottom line */
|
||||
/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */
|
||||
|
||||
@@ -39,9 +39,7 @@ E NEARDATA int warn_obj_cnt; /* count of monsters meeting criteria */
|
||||
E int x_maze_max, y_maze_max;
|
||||
E int otg_temp;
|
||||
|
||||
#ifdef REDO
|
||||
E NEARDATA int in_doagain;
|
||||
#endif
|
||||
|
||||
E struct dgn_topology { /* special dungeon levels for speed */
|
||||
d_level d_oracle_level;
|
||||
|
||||
@@ -182,11 +182,9 @@ E int NDECL(wiz_wish);
|
||||
#endif /* USE_TRAMPOLI */
|
||||
E void NDECL(reset_occupations);
|
||||
E void FDECL(set_occupation, (int (*)(void),const char *,int));
|
||||
#ifdef REDO
|
||||
E char NDECL(pgetchar);
|
||||
E void FDECL(pushch, (CHAR_P));
|
||||
E void FDECL(savech, (CHAR_P));
|
||||
#endif
|
||||
E void NDECL(add_debug_extended_commands);
|
||||
E void FDECL(reset_commands, (BOOLEAN_P));
|
||||
E void FDECL(rhack, (char *));
|
||||
|
||||
@@ -134,12 +134,6 @@ typedef char nhptext;
|
||||
*/
|
||||
#define LARGEST_INT 32767
|
||||
|
||||
|
||||
#ifdef REDO
|
||||
#define Getchar pgetchar
|
||||
#endif
|
||||
|
||||
|
||||
#include "coord.h"
|
||||
/*
|
||||
* Automatic inclusions for the subsidiary files.
|
||||
|
||||
@@ -229,11 +229,6 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len);
|
||||
#define ALLOCA_HACK /* used in util/panic.c */
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
#undef Getchar
|
||||
#define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
extern int FDECL(set_win32_option, (const char *, const char *));
|
||||
#ifdef WIN32CON
|
||||
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
|
||||
|
||||
@@ -100,11 +100,6 @@
|
||||
#define sethanguphandler(foo) (void)signal(SIGHUP, (SIG_RET_TYPE)foo)
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
# undef Getchar
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
void hangup(int i);
|
||||
#endif /* OS2CONF_H */
|
||||
#endif /* OS2 */
|
||||
|
||||
@@ -249,11 +249,6 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef REDO
|
||||
# undef Getchar
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
# define TEXTCOLOR /* */
|
||||
# define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
|
||||
|
||||
@@ -281,9 +281,6 @@
|
||||
|
||||
#define HLOCK "perm" /* an empty file used for locking purposes */
|
||||
|
||||
#ifndef REDO
|
||||
#define Getchar nhgetch
|
||||
#endif
|
||||
#define tgetch getchar
|
||||
|
||||
#ifndef NOSHELL
|
||||
|
||||
@@ -234,9 +234,6 @@ typedef __mode_t mode_t;
|
||||
# define O_TRUNC 0x400
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
#define tgetch vms_getchar
|
||||
|
||||
#include "system.h"
|
||||
|
||||
@@ -185,11 +185,6 @@ extern void NDECL(toggle_mouse_support);
|
||||
#define ALLOCA_HACK /* used in util/panic.c */
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
#undef Getchar
|
||||
#define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if 0
|
||||
#pragma warning(disable:4018) /* signed/unsigned mismatch */
|
||||
|
||||
@@ -246,11 +246,9 @@ boolean resuming;
|
||||
if (!next_to_u()) {
|
||||
check_leash(old_ux, old_uy);
|
||||
}
|
||||
#ifdef REDO
|
||||
/* clear doagain keystrokes */
|
||||
pushch(0);
|
||||
savech(0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* delayed change may not be valid anymore */
|
||||
@@ -355,12 +353,10 @@ boolean resuming;
|
||||
#if defined(MICRO) || defined(WIN32)
|
||||
abort_lev = 0;
|
||||
if (kbhit()) {
|
||||
if ((ch = Getchar()) == ABORT)
|
||||
if ((ch = pgetchar()) == ABORT)
|
||||
abort_lev++;
|
||||
# ifdef REDO
|
||||
else
|
||||
pushch(ch);
|
||||
# endif /* REDO */
|
||||
}
|
||||
if (!abort_lev && (*occupation)() == 0)
|
||||
#else
|
||||
@@ -439,10 +435,8 @@ stop_occupation()
|
||||
You("stop %s.", occtxt);
|
||||
occupation = 0;
|
||||
context.botl = 1; /* in case u.uhs changed */
|
||||
#ifdef REDO
|
||||
nomul(0);
|
||||
pushch(0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
24
src/cmd.c
24
src/cmd.c
@@ -236,7 +236,6 @@ int xtime;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef REDO
|
||||
|
||||
STATIC_DCL char NDECL(popch);
|
||||
|
||||
@@ -298,7 +297,6 @@ char ch;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif /* REDO */
|
||||
|
||||
STATIC_PTR int
|
||||
doextcmd(VOID_ARGS) /* here after # - now read a full-word command */
|
||||
@@ -2950,7 +2948,6 @@ register char *cmd;
|
||||
context.move = FALSE;
|
||||
return;
|
||||
}
|
||||
#ifdef REDO
|
||||
if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
|
||||
in_doagain = TRUE;
|
||||
stail = 0;
|
||||
@@ -2960,9 +2957,6 @@ register char *cmd;
|
||||
}
|
||||
/* Special case of *cmd == ' ' handled better below */
|
||||
if(!*cmd || *cmd == (char)0377)
|
||||
#else
|
||||
if(!*cmd || *cmd == (char)0377 || (!flags.rest_on_space && *cmd == ' '))
|
||||
#endif
|
||||
{
|
||||
nhbell();
|
||||
context.move = FALSE;
|
||||
@@ -3253,11 +3247,9 @@ const char *s;
|
||||
int is_mov;
|
||||
|
||||
retry:
|
||||
#ifdef REDO
|
||||
if (in_doagain || *readchar_queue)
|
||||
dirsym = readchar();
|
||||
else
|
||||
#endif
|
||||
dirsym = yn_function((s && *s != '^') ? s : "In what direction?",
|
||||
(char *)0, '\0');
|
||||
/* remove the prompt string so caller won't have to */
|
||||
@@ -3267,9 +3259,7 @@ const char *s;
|
||||
docrt(); /* redraw */
|
||||
goto retry;
|
||||
}
|
||||
#ifdef REDO
|
||||
savech(dirsym);
|
||||
#endif
|
||||
|
||||
if (dirsym == '.' || dirsym == 's') {
|
||||
u.dx = u.dy = u.dz = 0;
|
||||
@@ -3554,14 +3544,12 @@ parse()
|
||||
if (foo == '\033') { /* esc cancels count (TH) */
|
||||
clear_nhwindow(WIN_MESSAGE);
|
||||
multi = last_multi = 0;
|
||||
# ifdef REDO
|
||||
} else if (foo == DOAGAIN || in_doagain) {
|
||||
multi = last_multi;
|
||||
} else {
|
||||
last_multi = multi;
|
||||
savech(0); /* reset input queue */
|
||||
savech((char)foo);
|
||||
# endif
|
||||
}
|
||||
|
||||
if (multi) {
|
||||
@@ -3589,9 +3577,7 @@ parse()
|
||||
if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' ||
|
||||
foo == 'F' || (Cmd.num_pad && (foo == '5' || foo == '-'))) {
|
||||
foo = readchar();
|
||||
#ifdef REDO
|
||||
savech((char)foo);
|
||||
#endif
|
||||
in_line[1] = foo;
|
||||
in_line[2] = 0;
|
||||
}
|
||||
@@ -3658,11 +3644,7 @@ readchar()
|
||||
if ( *readchar_queue )
|
||||
sym = *readchar_queue++;
|
||||
else
|
||||
#ifdef REDO
|
||||
sym = in_doagain ? Getchar() : nh_poskey(&x, &y, &mod);
|
||||
#else
|
||||
sym = Getchar();
|
||||
#endif
|
||||
sym = in_doagain ? pgetchar() : nh_poskey(&x, &y, &mod);
|
||||
|
||||
#ifdef NR_OF_EOFS
|
||||
if (sym == EOF) {
|
||||
@@ -3674,7 +3656,7 @@ readchar()
|
||||
*/
|
||||
do {
|
||||
clearerr(stdin); /* omit if clearerr is undefined */
|
||||
sym = Getchar();
|
||||
sym = pgetchar();
|
||||
} while (--cnt && sym == EOF);
|
||||
}
|
||||
#endif /* NR_OF_EOFS */
|
||||
@@ -3687,7 +3669,7 @@ readchar()
|
||||
#ifdef ALTMETA
|
||||
} else if (sym == '\033' && alt_esc) {
|
||||
/* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */
|
||||
sym = *readchar_queue ? *readchar_queue++ : Getchar();
|
||||
sym = *readchar_queue ? *readchar_queue++ : pgetchar();
|
||||
if (sym == EOF || sym == 0)
|
||||
sym = '\033';
|
||||
else if (sym != '\033')
|
||||
|
||||
@@ -31,9 +31,7 @@ int x_maze_max = (COLNO-1) & ~1,
|
||||
|
||||
int otg_temp; /* used by object_to_glyph() [otg] */
|
||||
|
||||
#ifdef REDO
|
||||
NEARDATA int in_doagain = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following structure will be initialized at startup time with
|
||||
|
||||
12
src/invent.c
12
src/invent.c
@@ -928,11 +928,9 @@ register const char *let,*word;
|
||||
Sprintf(qbuf, "What do you want to %s? [%s or ?*]",
|
||||
word, buf);
|
||||
}
|
||||
#ifdef REDO
|
||||
if (in_doagain)
|
||||
ilet = readchar();
|
||||
else
|
||||
#endif
|
||||
ilet = yn_function(qbuf, (char *)0, '\0');
|
||||
if (digit(ilet) && !allowcnt) {
|
||||
pline("No count allowed with this command.");
|
||||
@@ -940,9 +938,7 @@ register const char *let,*word;
|
||||
}
|
||||
if (ilet == '0') prezero = TRUE;
|
||||
while (digit(ilet)) {
|
||||
#ifdef REDO
|
||||
if (ilet != '?' && ilet != '*') savech(ilet);
|
||||
#endif
|
||||
/* accumulate unless cnt has overflowed */
|
||||
if (allowcnt < 3) {
|
||||
prevcnt = cnt;
|
||||
@@ -1018,23 +1014,17 @@ register const char *let,*word;
|
||||
}
|
||||
}
|
||||
context.botl = 1; /* May have changed the amount of money */
|
||||
#ifdef REDO
|
||||
savech(ilet);
|
||||
#endif
|
||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
||||
if (otmp->invlet == ilet) break;
|
||||
if(!otmp) {
|
||||
You("don't have that object.");
|
||||
#ifdef REDO
|
||||
if (in_doagain) return((struct obj *) 0);
|
||||
#endif
|
||||
continue;
|
||||
} else if (cnt < 0 || otmp->quan < cnt) {
|
||||
You("don't have that many! You have only %ld.",
|
||||
otmp->quan);
|
||||
#ifdef REDO
|
||||
if (in_doagain) return((struct obj *) 0);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -2102,9 +2092,7 @@ dotypeinv()
|
||||
|
||||
if(class_count > 1) {
|
||||
c = yn_function(prompt, types, '\0');
|
||||
#ifdef REDO
|
||||
savech(c);
|
||||
#endif
|
||||
if(c == '\0') {
|
||||
clear_nhwindow(WIN_MESSAGE);
|
||||
return 0;
|
||||
|
||||
@@ -568,9 +568,7 @@ doclassdisco()
|
||||
}
|
||||
/* get the class (via its symbol character) */
|
||||
c = yn_function(prompt, discosyms, '\0');
|
||||
#ifdef REDO
|
||||
savech(c);
|
||||
#endif
|
||||
if (!c)
|
||||
clear_nhwindow(WIN_MESSAGE);
|
||||
} else {
|
||||
|
||||
@@ -407,7 +407,7 @@ const char *str;
|
||||
#else
|
||||
msmsg("Hit <Enter> %s.", str);
|
||||
#endif
|
||||
while (Getchar() != '\n') ;
|
||||
while (pgetchar() != '\n') ;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1261,9 +1261,6 @@ static const char *build_opts[] = {
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef REDO
|
||||
"redo command",
|
||||
#endif
|
||||
#ifdef SELECTSAVED
|
||||
"restore saved games via menu",
|
||||
#endif
|
||||
|
||||
@@ -82,7 +82,7 @@ getlin_hook_proc hook;
|
||||
#else
|
||||
Strcat(strcat(strcpy(toplines, query), " "), obufp);
|
||||
#endif
|
||||
c = Getchar();
|
||||
c = pgetchar();
|
||||
if (c == '\033' || c == EOF) {
|
||||
obufp[0] = '\033';
|
||||
obufp[1] = '\0';
|
||||
@@ -271,26 +271,20 @@ tty_get_ext_cmd()
|
||||
if (iflags.extmenu) return extcmd_via_menu();
|
||||
/* maybe a runtime option? */
|
||||
/* hooked_tty_getlin("#", buf, flags.cmd_comp ? ext_cmd_getlin_hook : (getlin_hook_proc) 0); */
|
||||
#ifdef REDO
|
||||
hooked_tty_getlin("#", buf, in_doagain ? (getlin_hook_proc)0
|
||||
: ext_cmd_getlin_hook);
|
||||
#else
|
||||
hooked_tty_getlin("#", buf, ext_cmd_getlin_hook);
|
||||
#endif
|
||||
(void) mungspaces(buf);
|
||||
if (buf[0] == 0 || buf[0] == '\033') return -1;
|
||||
|
||||
for (i = 0; extcmdlist[i].ef_txt != (char *)0; i++)
|
||||
if (!strcmpi(buf, extcmdlist[i].ef_txt)) break;
|
||||
|
||||
#ifdef REDO
|
||||
if (!in_doagain) {
|
||||
int j;
|
||||
for (j = 0; buf[j]; j++)
|
||||
savech(buf[j]);
|
||||
savech('\n');
|
||||
}
|
||||
#endif
|
||||
|
||||
if (extcmdlist[i].ef_txt == (char *)0) {
|
||||
pline("%s: unknown extended command.", buf);
|
||||
|
||||
Reference in New Issue
Block a user