avoid possible problems with alignment overflow, and provide a centralized location for any future alignment limits */
| 1295 | /* avoid possible problems with alignment overflow, and provide a centralized |
| 1296 | location for any future alignment limits */ |
| 1297 | void |
| 1298 | adjalign(int n) |
| 1299 | { |
| 1300 | int newalign = u.ualign.record + n; |
| 1301 | |
| 1302 | if (n < 0) { |
| 1303 | unsigned newabuse = u.ualign.abuse - n; |
| 1304 | |
| 1305 | if (newalign < u.ualign.record) |
| 1306 | u.ualign.record = newalign; |
| 1307 | if (newabuse > u.ualign.abuse) { |
| 1308 | u.ualign.abuse = newabuse; |
| 1309 | adj_erinys(newabuse); |
| 1310 | } |
| 1311 | } else if (newalign > u.ualign.record) { |
| 1312 | u.ualign.record = newalign; |
| 1313 | if (u.ualign.record > ALIGNLIM) |
| 1314 | u.ualign.record = (int)ALIGNLIM; |
| 1315 | } |
| 1316 | } |
| 1317 | |
| 1318 | /* change hero's alignment type, possibly losing use of artifacts */ |
| 1319 | void |
no test coverage detected