Re-fix altar compiler warning

Implement a better fix for commit 2f4f7d22d ("Fix align type
mixup wth align mask") which was reverted in commit 4e35e8b5a
("Revert "Fix align type mixup wth align mask"").

In the present code, the field align in both struct altar and
struct monster is not an aligntyp, but an align mask with extra flags.
Change the type to match its actual use and improve the naming.

Consolidate duplicated code into a single routine.

Change the return type of induced_align() to be unsigned to match
amask usage.

Change the special level align mask values to be separate from
the normal align mask values.
This commit is contained in:
Dean Luick
2021-02-07 22:25:25 -06:00
parent ebc2dfdcf2
commit 5eaf028c0f
5 changed files with 48 additions and 41 deletions

View File

@@ -132,7 +132,7 @@ typedef struct {
typedef struct {
Str_or_Len name, appear_as;
short id;
aligntyp align;
unsigned int sp_amask; /* splev amask */
packed_coord coord;
xchar x, y, class, appear;
schar peaceful, asleep;
@@ -159,7 +159,7 @@ typedef struct {
typedef struct {
packed_coord coord;
xchar x, y;
aligntyp align;
unsigned int sp_amask; /* splev amask */
xchar shrine;
} altar;