get a monster's alignment type without caller needing EPRI & EMIN */
| 277 | |
| 278 | /* get a monster's alignment type without caller needing EPRI & EMIN */ |
| 279 | aligntyp |
| 280 | mon_aligntyp(struct monst *mon) |
| 281 | { |
| 282 | aligntyp algn = mon->ispriest ? EPRI(mon)->shralign |
| 283 | : mon->isminion ? EMIN(mon)->min_align |
| 284 | : mon->data->maligntyp; |
| 285 | |
| 286 | if (algn == A_NONE) |
| 287 | return A_NONE; /* negative but differs from chaotic */ |
| 288 | return (algn > 0) ? A_LAWFUL : (algn < 0) ? A_CHAOTIC : A_NEUTRAL; |
| 289 | } |
| 290 | |
| 291 | /* |
| 292 | * Specially aligned monsters are named specially. |
no outgoing calls
no test coverage detected