From 8629b4a298e31f81ba0db0debb4796356c3966c7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 12 Feb 2005 03:56:02 +0000 Subject: [PATCH] Fix several minor bugs reported by Stas Sergeev. --- io.c | 4 ++-- makefile | 2 +- planets.c | 6 +++--- sst-doc.xml | 4 ++-- sst.c | 13 +++++++------ sst.h | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/io.c b/io.c index 04fc979..9b96802 100644 --- a/io.c +++ b/io.c @@ -169,7 +169,7 @@ void prouts(char *fmt, ...) va_end(ap); skip(1); for (s = buf; *s; s++) { - delay(200); + delay(30); if (game.options & OPTION_CURSES) { waddch(curwnd, *s); wrefresh(curwnd); @@ -301,7 +301,7 @@ void drawmaps(short l) { if (game.options & OPTION_CURSES) { if (l == 1) - sensor(FALSE); + sensor(); if (l != 2) { setwnd(srscan_window); wmove(curwnd, 0, 0); diff --git a/makefile b/makefile index f9c7d5a..7745e73 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ VERS=$(shell sed url='http://developer.berlios.de/projects/sst/'>project site. -After I launched the Berlios project, Stas Sergeev contacted me -me. We worked together to merge in his changes. +After I launched the Berlios project, Stas Sergeev contacted me. +We worked together to merge in his changes. Modifications I've made: diff --git a/sst.c b/sst.c index 2dca29e..3d394c6 100644 --- a/sst.c +++ b/sst.c @@ -195,7 +195,7 @@ commands[] = { {"DEBUG", DEBUGCMD, 0}, #define MAYDAY 32 {"MAYDAY", MAYDAY, 0}, - {"SOS", MAYDAY, 0}, + //{"SOS", MAYDAY, 0}, {"CALL", MAYDAY, 0}, #define QUIT 33 {"QUIT", QUIT, 0}, @@ -204,12 +204,13 @@ commands[] = { }; #define NUMCOMMANDS sizeof(commands)/sizeof(commands[0]) +#define ACCEPT(i) (!commands[i].option || (commands[i].option & game.options)) static void listCommands(void) { int i, k = 0; proutn("LEGAL COMMANDS ARE:"); for (i = 0; i < NUMCOMMANDS; i++) { - if (commands[i].option && !(commands[i].option & game.options)) + if (!ACCEPT(i)) continue; if (k % 5 == 0) skip(1); @@ -237,7 +238,7 @@ static void helpme(void) setwnd(message_window); if (key == IHEOL) return; for (i = 0; i < NUMCOMMANDS; i++) { - if (strcasecmp(commands[i].name, citem)==0) { + if (ACCEPT(i) && strcasecmp(commands[i].name, citem)==0) { i = commands[i].value; break; } @@ -325,14 +326,14 @@ static void makemoves(void) setwnd(message_window); clrscr(); for (i=0; i < ABANDON; i++) - if (isit(commands[i].name)) { + if (ACCEPT(i) && isit(commands[i].name)) { v = commands[i].value; break; } if (i < ABANDON && (!commands[i].option || (commands[i].option & game.options))) break; for (; i < NUMCOMMANDS; i++) - if (strcasecmp(commands[i].name, citem) == 0) { + if (ACCEPT(i) && strcasecmp(commands[i].name, citem) == 0) { v = commands[i].value; break; } @@ -396,7 +397,7 @@ static void makemoves(void) score(); break; case SENSORS: // sensors - sensor(TRUE); + sensor(); break; case ORBIT: // orbit orbit(); diff --git a/sst.h b/sst.h index 74f8d6a..83db771 100644 --- a/sst.h +++ b/sst.h @@ -461,7 +461,7 @@ void prouts(char *, ...); int isit(char *); void preport(void); void orbit(void); -void sensor(int); +void sensor(void); void drawmaps(short); void beam(void); void mine(void); -- 2.31.1