Make sector types signed
get_empobj_chr() and emp_obj_chr_name() access struct sctstr member sct_type through struct empobj member type. This is technically non-portable, because the two differ in signedness. It was also undocumented. Fix by making sct_type signed. sct_newtype as well, for consistency. map_char() uses unsigned char for a sector type argument. Change that to int. Matches how this is done elsewhere.
This commit is contained in:
parent
f8a35dda1e
commit
fc807a4c0a
4 changed files with 8 additions and 7 deletions
|
@ -56,7 +56,8 @@ struct empobj {
|
|||
short uid;
|
||||
coord x; /* is valid if EFF_XY is set in table def. */
|
||||
coord y; /* is valid if EFF_XY is set in table def. */
|
||||
signed char type;
|
||||
signed char type; /* is valid for sectors and units */
|
||||
/* remaining are valid for units */
|
||||
signed char effic;
|
||||
signed char mobil;
|
||||
unsigned char off;
|
||||
|
|
|
@ -48,8 +48,8 @@ struct sctstr {
|
|||
short sct_elev; /* elevation/depth */
|
||||
coord sct_x; /* x coord of sector */
|
||||
coord sct_y; /* y coord of sector */
|
||||
signed char sct_type; /* sector type */
|
||||
/* end of part matching struct empobj */
|
||||
unsigned char sct_type; /* sector type */
|
||||
unsigned char sct_effic; /* 0% to 100% */
|
||||
short sct_mobil; /* mobility units */
|
||||
unsigned char sct_loyal; /* updates until civilans "converted" */
|
||||
|
@ -65,7 +65,7 @@ struct sctstr {
|
|||
short sct_fill; /* gunk */
|
||||
unsigned char sct_work; /* pct of civ actually working */
|
||||
unsigned char sct_coastal; /* is this a coastal sector? */
|
||||
unsigned char sct_newtype; /* for changing designations */
|
||||
signed char sct_newtype; /* for changing designations */
|
||||
unsigned char sct_min; /* ease of mining ore */
|
||||
unsigned char sct_gmin; /* amount of gold ore */
|
||||
unsigned char sct_fertil; /* fertility of soil */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue