X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=3d394c67b4da2097edf5f027d119589227e3c5e3;hb=8629b4a298e31f81ba0db0debb4796356c3966c7;hp=dd73713dc7a3d1ac8a56cff1d8b5b0d7d35a7893;hpb=79896d464e17c2bbae8b46e808c0998ea4abb8b9;p=super-star-trek.git diff --git a/sst.c b/sst.c index dd73713..3d394c6 100644 --- a/sst.c +++ b/sst.c @@ -114,8 +114,7 @@ Eric Raymond's changes: 2. Status report now indicates when dilithium crystals are on board. - 3. Can now report starbases left in scrscan. - + 3. Per Dave Matuszek's remarks, Thingy state is not saved across games. */ /* the input queue */ @@ -196,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}, @@ -205,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); @@ -238,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; } @@ -326,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; } @@ -397,7 +397,7 @@ static void makemoves(void) score(); break; case SENSORS: // sensors - sensor(TRUE); + sensor(); break; case ORBIT: // orbit orbit(); @@ -484,14 +484,14 @@ static void makemoves(void) events(); if (alldone) break; // Events did us in } - if (game.state.galaxy[quadx][quady] == SUPERNOVA_PLACE) { // Galaxy went Nova! + if (game.state.galaxy[quadx][quady].supernova) { // Galaxy went Nova! atover(0); continue; } if (hitme && justin==0) { attack(2); if (alldone) break; - if (game.state.galaxy[quadx][quady] == SUPERNOVA_PLACE) { // went NOVA! + if (game.state.galaxy[quadx][quady].supernova) { // went NOVA! atover(0); hitme = TRUE; continue; @@ -748,7 +748,7 @@ void debugme(void) proutn("Reset damage? "); if (ja() != 0) { int i; - for (i=0; i <= NDEVICES; i++) + for (i=0; i < NDEVICES; i++) if (game.damage[i] > 0.0) game.damage[i] = 0.0; stdamtim = 1e30; @@ -762,7 +762,7 @@ void debugme(void) proutn("Cause selective damage? "); if (ja() != 0) { int i, key; - for (i=1; i <= NDEVICES; i++) { + for (i=0; i < NDEVICES; i++) { proutn("Kill "); proutn(device[i]); proutn("? ");