Narrow struct sctstr member sct_mobil to char
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 31 Dec 2009 10:39:17 +0000 (11:39 +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 mobility.

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

index b86b537296c30d2b6b5a7e343bb7df106b7a126f..e931e02bb5845fa27b09a91e5928cd77b437ebe7 100644 (file)
@@ -55,7 +55,7 @@ struct sctstr {
     signed char sct_type;      /* sector type */
     /* end of part matching struct empobj */
     signed char sct_effic;     /* 0% to 100% */
-    short sct_mobil;           /* mobility units */
+    signed char sct_mobil;     /* mobility units */
     unsigned char sct_loyal;   /* updates until civilans "converted" */
     unsigned char sct_terr;    /* territory 0 id # of sector */
     unsigned char sct_terr1;   /* territory 1 id # of sector */
index 92be99cf751469f3ceb8682bdf6d61b9c6b4fe24..1739ce14f6234deeb05bcc4d3dd5dee88b96a4d8 100644 (file)
@@ -235,7 +235,7 @@ setsector(void)
                    current = 127;
                pr("Mobility in %s changed to %d.\n",
                   xyas(sect.sct_x, sect.sct_y, player->cnum), current);
-               sect.sct_mobil = (short)current;
+               sect.sct_mobil = current;
                putsect(&sect);
            }
            break;
index 97de2ef90efba1745578eb1b1da4d770ff0f8452..adab42c42791cd09469e323d89410ad83b064693 100644 (file)
@@ -140,7 +140,7 @@ struct castr sect_ca[] = {
     {"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_CHAR, 0, NULL, EF_BAD, 0},
-    {"mobil", fldoff(sct_mobil), NSC_SHORT, 0, NULL, EF_BAD, 0},
+    {"mobil", fldoff(sct_mobil), NSC_CHAR, 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},
     {"terr0", fldoff(sct_terr), NSC_UCHAR, 0, NULL, EF_BAD, 0},
index a5abbbe65d652c3fc0ae0352d6b2f9cad2d67617..3a8ada3f7bf5668567e3ff4fb8587217fd800ae2 100644 (file)
@@ -353,12 +353,12 @@ put_combat(struct combat *com)
                if ((com->mob - com->mobcost) < -127)
                    sect.sct_mobil = -127;
                else
-                   sect.sct_mobil = (short)(com->mob - com->mobcost);
+                   sect.sct_mobil = com->mob - com->mobcost;
            } else {
                if ((com->mob - com->mobcost) < 0)
                    sect.sct_mobil = 0;
                else
-                   sect.sct_mobil = (short)(com->mob - com->mobcost);
+                   sect.sct_mobil = com->mob - com->mobcost;
            }
        }
        sect.sct_own = com->own;