From aa659c77540f482c41ec4d9a764daba8ca026e61 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 31 Dec 2009 11:39:17 +0100 Subject: [PATCH] Narrow struct sctstr member sct_mobil to char To bring it in line with unit mobility. --- include/sect.h | 2 +- src/lib/commands/setsect.c | 2 +- src/lib/common/nsc.c | 2 +- src/lib/subs/attsub.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sect.h b/include/sect.h index b86b53729..e931e02bb 100644 --- a/include/sect.h +++ b/include/sect.h @@ -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 */ diff --git a/src/lib/commands/setsect.c b/src/lib/commands/setsect.c index 92be99cf7..1739ce14f 100644 --- a/src/lib/commands/setsect.c +++ b/src/lib/commands/setsect.c @@ -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(§); } break; diff --git a/src/lib/common/nsc.c b/src/lib/common/nsc.c index 97de2ef90..adab42c42 100644 --- a/src/lib/common/nsc.c +++ b/src/lib/common/nsc.c @@ -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}, diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index a5abbbe65..3a8ada3f7 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -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; -- 2.43.0