X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=5fddb15ee24e25cafb1321041dce3eef7eaf8f6b;hb=e7c2a3097e455ce93c62a21832e5c584031468db;hp=65c79ac6c35e48618e8ae03acf5af0b9779bcf58;hpb=5db6160de8bad4de189d3b54dd54011260c7a34f;p=super-star-trek.git diff --git a/sst.c b/sst.c index 65c79ac..5fddb15 100644 --- a/sst.c +++ b/sst.c @@ -114,9 +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. - - 4. Per Dave Matuszek's remarks, Thingy state is not saved across games. + 3. Per Dave Matuszek's remarks, Thingy state is not saved across games. */ /* the input queue */ @@ -197,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}, @@ -206,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); @@ -239,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; } @@ -327,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; } @@ -398,7 +397,7 @@ static void makemoves(void) score(); break; case SENSORS: // sensors - sensor(TRUE); + sensor(); break; case ORBIT: // orbit orbit(); @@ -485,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; @@ -752,7 +751,6 @@ void debugme(void) for (i=0; i < NDEVICES; i++) if (game.damage[i] > 0.0) game.damage[i] = 0.0; - stdamtim = 1e30; } proutn("Toggle idebug? "); if (ja() != 0) { @@ -771,7 +769,6 @@ void debugme(void) key = scan(); if (key == IHALPHA && isit("y")) { game.damage[i] = 10.0; - if (i == DRADIO) stdamtim = game.state.date; } } } @@ -780,7 +777,7 @@ void debugme(void) int i; for (i = 1; i < NEVENTS; i++) { int key; - if (game.future[i] == 1e30) continue; + if (game.future[i] == FOREVER) continue; switch (i) { case FSNOVA: proutn("Supernova "); break; case FTBEAM: proutn("T Beam "); break;