#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) */
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;
#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 *));
*/
#define LARGEST_INT 32767
-
-#ifdef REDO
-#define Getchar pgetchar
-#endif
-
-
#include "coord.h"
/*
* Automatic inclusions for the subsidiary files.
#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
#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 */
#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 */
#define HLOCK "perm" /* an empty file used for locking purposes */
-#ifndef REDO
-#define Getchar nhgetch
-#endif
#define tgetch getchar
#ifndef NOSHELL
# define O_TRUNC 0x400
#endif
-#ifndef REDO
-# define Getchar nhgetch
-#endif
#define tgetch vms_getchar
#include "system.h"
#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 */
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 */
#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
You("stop %s.", occtxt);
occupation = 0;
context.botl = 1; /* in case u.uhs changed */
-#ifdef REDO
nomul(0);
pushch(0);
-#endif
}
}
return;
}
-#ifdef REDO
STATIC_DCL char NDECL(popch);
}
return;
}
-#endif /* REDO */
STATIC_PTR int
doextcmd(VOID_ARGS) /* here after # - now read a full-word command */
context.move = FALSE;
return;
}
-#ifdef REDO
if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
in_doagain = TRUE;
stail = 0;
}
/* 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;
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 */
docrt(); /* redraw */
goto retry;
}
-#ifdef REDO
savech(dirsym);
-#endif
if (dirsym == '.' || dirsym == 's') {
u.dx = u.dy = u.dz = 0;
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) {
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;
}
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) {
*/
do {
clearerr(stdin); /* omit if clearerr is undefined */
- sym = Getchar();
+ sym = pgetchar();
} while (--cnt && sym == EOF);
}
#endif /* NR_OF_EOFS */
#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')
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
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.");
}
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;
}
}
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;
if(class_count > 1) {
c = yn_function(prompt, types, '\0');
-#ifdef REDO
savech(c);
-#endif
if(c == '\0') {
clear_nhwindow(WIN_MESSAGE);
return 0;
}
/* 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 {
#else
msmsg("Hit <Enter> %s.", str);
#endif
- while (Getchar() != '\n') ;
+ while (pgetchar() != '\n') ;
return;
}
# endif
# endif
#endif
-#ifdef REDO
- "redo command",
-#endif
#ifdef SELECTSAVED
"restore saved games via menu",
#endif
#else
Strcat(strcat(strcpy(toplines, query), " "), obufp);
#endif
- c = Getchar();
+ c = pgetchar();
if (c == '\033' || c == EOF) {
obufp[0] = '\033';
obufp[1] = '\0';
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);