Make struct sctstr member sct_effic signed
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 31 Dec 2009 10:36:59 +0000 (11:36 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2010 07:37:05 +0000 (08:37 +0100)
To bring it in line with unit efficiency.

include/sect.h
src/lib/commands/edit.c
src/lib/commands/setsect.c
src/lib/common/nsc.c

index 62e634cea1e357eb947cf2b2307a9cf3d614d1b5..b86b537296c30d2b6b5a7e343bb7df106b7a126f 100644 (file)
@@ -54,7 +54,7 @@ struct sctstr {
     coord sct_y;               /* y coord of sector */
     signed char sct_type;      /* sector type */
     /* end of part matching struct empobj */
-    unsigned char sct_effic;   /* 0% to 100% */
+    signed char sct_effic;     /* 0% to 100% */
     short sct_mobil;           /* mobility units */
     unsigned char sct_loyal;   /* updates until civilans "converted" */
     unsigned char sct_terr;    /* territory 0 id # of sector */
index 21eec43db7d02669bc836d8846f081c36a86e458..5d9c767ac5ba40d5879b54ba64062d11e0af4b57 100644 (file)
@@ -487,7 +487,7 @@ doland(char op, int arg, char *p, struct sctstr *sect)
     case 'e':
        new = errcheck(arg, 0, 100);
        noise(sect, "Efficiency", sect->sct_effic, new);
-       sect->sct_effic = (unsigned char)new;
+       sect->sct_effic = new;
        break;
     case 'm':
        new = errcheck(arg, -127, 255);
index eae4344abbc350eba76de98448fec19b68bce0cc..92be99cf751469f3ceb8682bdf6d61b9c6b4fe24 100644 (file)
@@ -193,7 +193,7 @@ setsector(void)
                current = 100;
            pr("Efficiency in %s changed to %d.\n",
               xyas(sect.sct_x, sect.sct_y, player->cnum), current);
-           sect.sct_effic = (unsigned char)current;
+           sect.sct_effic = current;
            putsect(&sect);
        }
        break;
index 1281459a4cc50a315a48193fa9861ea83bd3cc83..97de2ef90efba1745578eb1b1da4d770ff0f8452 100644 (file)
@@ -139,7 +139,7 @@ struct castr sect_ca[] = {
     {"xloc", fldoff(sct_x), NSC_XCOORD, 0, NULL, EF_BAD, NSC_CONST},
     {"yloc", fldoff(sct_y), NSC_YCOORD, 0, NULL, EF_BAD, NSC_CONST},
     {"des", fldoff(sct_type), NSC_CHAR, 0, NULL, EF_SECTOR_CHR, 0},
-    {"effic", fldoff(sct_effic), NSC_UCHAR, 0, NULL, EF_BAD, 0},
+    {"effic", fldoff(sct_effic), NSC_CHAR, 0, NULL, EF_BAD, 0},
     {"mobil", fldoff(sct_mobil), NSC_SHORT, 0, NULL, EF_BAD, 0},
     {"loyal", fldoff(sct_loyal), NSC_UCHAR, 0, NULL, EF_BAD, NSC_DEITY},
     {"terr", 0, NSC_UCHAR, 0, nsc_sct_terr, EF_BAD, NSC_EXTRA},