Fixes the bug that was directing help lookups incorrectly.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 15 Sep 2006 20:58:05 +0000 (20:58 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 15 Sep 2006 20:58:05 +0000 (20:58 +0000)
Renames the old "help()" function to "mayday()" to match the new command.
Fixes display bugs in curses due to generation of wacky quotes, nonbreak
spaces, and dashes.  Does not fix problems with forms-drawing characters.

doc/makehelp.py
doc/sst-doc.xml
src/moving.c
src/sst.c
src/sst.h

index 460fef14dde3fb6a5474eb971c6d0853bc60efd6..835b8731394524155444e446ef5229ce5b45106c 100755 (executable)
@@ -37,6 +37,10 @@ while True:
         line = line.replace("%", "%%")
         # Hack Unicode non-breaking spaces into ordinary spaces
         line = line.replace("\xc2\xa0", " ").replace("\240", "")
         line = line.replace("%", "%%")
         # Hack Unicode non-breaking spaces into ordinary spaces
         line = line.replace("\xc2\xa0", " ").replace("\240", "")
+        # Hack right and left quotes into regular ASCII quotes
+        line = line.replace("\xe2\x80\x9c", '"').replace("\xe2\x80\x9d", '"')
+        # Hack dashes and bullets (Hmmm...might want to handle this in curses)
+        line = line.replace("\xe2\x80\x94", "-").replace("\xe2\x97\x8f", "*");
         if line.startswith("Mnemonic:"):
             while not savetext[-1].strip():
                 savetext.pop()
         if line.startswith("Mnemonic:"):
             while not savetext[-1].strip():
                 savetext.pop()
index ec0a208389d66a8dfb4f374cd2072a51a3eac8cd..268d8c18eb24242a19ef7d64b429cc18d580cab1 100644 (file)
@@ -407,6 +407,7 @@ short-range scan anytime you like.</para>
 
 <para>If your short-range sensors are damaged, this command will only show
 the contents of adjacent sectors.</para>
 
 <para>If your short-range sensors are damaged, this command will only show
 the contents of adjacent sectors.</para>
+
 </sect1>
 <sect1><title>Status Report</title>
 
 </sect1>
 <sect1><title>Status Report</title>
 
@@ -596,6 +597,7 @@ galaxy, which you are not permitted to cross.</para>
 
 <para>Long-range scans are free.  They use up no energy or time, and can be
 done safely regardless of battle conditions.</para>
 
 <para>Long-range scans are free.  They use up no energy or time, and can be
 done safely regardless of battle conditions.</para>
+
 </sect1>
 <sect1><title>Star Chart</title>
 
 </sect1>
 <sect1><title>Star Chart</title>
 
index 24b6bb08a746bb29897a5e705c2d6f48710d3684..37ccb3ddc0104140303074e551e1596bbe899c52 100644 (file)
@@ -898,7 +898,7 @@ void probe(void)
     return;
 }
 
     return;
 }
 
-void help(void) 
+void mayday(void) 
 {
     /* There's more than one way to move in this game! */
     double ddist, xdist, probf;
 {
     /* There's more than one way to move in this game! */
     double ddist, xdist, probf;
index 4288bbbd8651e7e4c2ecfbb81c421108e4700a82..21c803e770c362e3b494d6ba0e6b818387fad743 100644 (file)
--- a/src/sst.c
+++ b/src/sst.c
@@ -208,66 +208,66 @@ commands[] = {
 #define TORPEDO        5
         {"TORPEDO",    TORPEDO,        0},
        {"PHOTONS",     TORPEDO,        0},
 #define TORPEDO        5
         {"TORPEDO",    TORPEDO,        0},
        {"PHOTONS",     TORPEDO,        0},
-#define MOVE   6
+#define MOVE   7
        {"MOVE",        MOVE,           0},
        {"MOVE",        MOVE,           0},
-#define SHIELDS        7
+#define SHIELDS        8
        {"SHIELDS",     SHIELDS,        0},
        {"SHIELDS",     SHIELDS,        0},
-#define DOCK   8
+#define DOCK   9
        {"DOCK",        DOCK,           0},
        {"DOCK",        DOCK,           0},
-#define DAMAGES        9
+#define DAMAGES        10
        {"DAMAGES",     DAMAGES,        0},
        {"DAMAGES",     DAMAGES,        0},
-#define CHART  10
+#define CHART  11
        {"CHART",       CHART,          0},
        {"CHART",       CHART,          0},
-#define IMPULSE        11
+#define IMPULSE        12
        {"IMPULSE",     IMPULSE,        0},
        {"IMPULSE",     IMPULSE,        0},
-#define REST   12
+#define REST   13
        {"REST",        REST,           0},
        {"REST",        REST,           0},
-#define WARP   13
+#define WARP   14
        {"WARP",        WARP,           0},
        {"WARP",        WARP,           0},
-#define SCORE  14
+#define SCORE  15
        {"SCORE",       SCORE,          0},
        {"SCORE",       SCORE,          0},
-#define SENSORS        15
+#define SENSORS        16
        {"SENSORS",     SENSORS,        OPTION_PLANETS},
        {"SENSORS",     SENSORS,        OPTION_PLANETS},
-#define ORBIT  16
+#define ORBIT  17
        {"ORBIT",       ORBIT,          OPTION_PLANETS},
        {"ORBIT",       ORBIT,          OPTION_PLANETS},
-#define TRANSPORT      17
+#define TRANSPORT      18
        {"TRANSPORT",   TRANSPORT,      OPTION_PLANETS},
        {"TRANSPORT",   TRANSPORT,      OPTION_PLANETS},
-#define MINE   18
+#define MINE   19
        {"MINE",        MINE,           OPTION_PLANETS},
        {"MINE",        MINE,           OPTION_PLANETS},
-#define CRYSTALS       19
+#define CRYSTALS       20
        {"CRYSTALS",    CRYSTALS,       OPTION_PLANETS},
        {"CRYSTALS",    CRYSTALS,       OPTION_PLANETS},
-#define SHUTTLE        20
+#define SHUTTLE        21
        {"SHUTTLE",     SHUTTLE,        OPTION_PLANETS},
        {"SHUTTLE",     SHUTTLE,        OPTION_PLANETS},
-#define PLANETS        21
+#define PLANETS        22
        {"PLANETS",     PLANETS,        OPTION_PLANETS},
        {"PLANETS",     PLANETS,        OPTION_PLANETS},
-#define REPORT 22
+#define REPORT 23
        {"REPORT",      REPORT,         0},
        {"REPORT",      REPORT,         0},
-#define COMPUTER       23
+#define COMPUTER       24
        {"COMPUTER",    COMPUTER,       0},
        {"COMPUTER",    COMPUTER,       0},
-#define COMMANDS       24
+#define COMMANDS       25
        {"COMMANDS",    COMMANDS,       0},
        {"COMMANDS",    COMMANDS,       0},
-#define EMEXIT 25
+#define EMEXIT 26
        {"EMEXIT",      EMEXIT,         0},
        {"EMEXIT",      EMEXIT,         0},
-#define PROBE  26
+#define PROBE  27
        {"PROBE",       PROBE,          OPTION_PROBE},
        {"PROBE",       PROBE,          OPTION_PROBE},
-#define SAVE   27
+#define SAVE   28
        {"SAVE",        SAVE,           0},
        {"FREEZE",      SAVE,           0},
        {"SAVE",        SAVE,           0},
        {"FREEZE",      SAVE,           0},
-#define ABANDON        28
+#define ABANDON        30
        {"ABANDON",     ABANDON,        0},
        {"ABANDON",     ABANDON,        0},
-#define DESTRUCT       29
+#define DESTRUCT       31
        {"DESTRUCT",    DESTRUCT,       0},
        {"DESTRUCT",    DESTRUCT,       0},
-#define DEATHRAY       30
+#define DEATHRAY       32
        {"DEATHRAY",    DEATHRAY,       0},
        {"DEATHRAY",    DEATHRAY,       0},
-#define DEBUGCMD       31
+#define DEBUGCMD       33
        {"DEBUG",       DEBUGCMD,       0},
        {"DEBUG",       DEBUGCMD,       0},
-#define MAYDAY 32
+#define MAYDAY 34
        {"MAYDAY",      MAYDAY,         0},
        //{"SOS",               MAYDAY,         0},
        //{"CALL",      MAYDAY,         0},
        {"MAYDAY",      MAYDAY,         0},
        //{"SOS",               MAYDAY,         0},
        //{"CALL",      MAYDAY,         0},
-#define QUIT   33
+#define QUIT   35
        {"QUIT",        QUIT,           0},
        {"QUIT",        QUIT,           0},
-#define HELP   34
+#define HELP   36
        {"HELP",        HELP,           0},
 };
 
        {"HELP",        HELP,           0},
 };
 
@@ -532,7 +532,7 @@ static void makemoves(void)
 #endif
            break;
        case MAYDAY:                    // Call for help
 #endif
            break;
        case MAYDAY:                    // Call for help
-           help();
+           mayday();
            if (game.ididit) hitme = TRUE;
            break;
        case QUIT:
            if (game.ididit) hitme = TRUE;
            break;
        case QUIT:
index 7e7d1d30dd0e9067e334a7df1f9f255c9a4de56b..321d802b2021131d466d9efa2efa02cf15281c42 100644 (file)
--- a/src/sst.h
+++ b/src/sst.h
@@ -326,7 +326,7 @@ void setwrp(void);
 void events(void);
 void report(void);
 void eta(void);
 void events(void);
 void report(void);
 void eta(void);
-void help(void);
+void mayday(void);
 void abandn(void);
 void finish(FINTYPE);
 void dstrct(void);
 void abandn(void);
 void finish(FINTYPE);
 void dstrct(void);