| 1741 | } |
| 1742 | |
| 1743 | void |
| 1744 | notice_all_mons(boolean reset) |
| 1745 | { |
| 1746 | if (a11y.mon_notices && !a11y.mon_notices_blocked) { |
| 1747 | struct monst *mtmp; |
| 1748 | struct monst **arr = NULL; |
| 1749 | int j, i = 0, cnt = 0; |
| 1750 | |
| 1751 | for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { |
| 1752 | if (DEADMONSTER(mtmp)) |
| 1753 | continue; |
| 1754 | if (canspotmon(mtmp)) |
| 1755 | cnt++; |
| 1756 | else if (reset) |
| 1757 | mtmp->mspotted = FALSE; |
| 1758 | } |
| 1759 | if (!cnt) |
| 1760 | return; |
| 1761 | |
| 1762 | arr = (struct monst **) alloc(cnt * sizeof (struct monst *)); |
| 1763 | |
| 1764 | for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { |
| 1765 | if (DEADMONSTER(mtmp)) |
| 1766 | continue; |
| 1767 | if (!canspotmon(mtmp)) |
| 1768 | mtmp->mspotted = FALSE; |
| 1769 | else if (i < cnt) |
| 1770 | arr[i++] = mtmp; |
| 1771 | } |
| 1772 | |
| 1773 | if (i) { |
| 1774 | qsort((genericptr_t) arr, (size_t) i, sizeof *arr, |
| 1775 | notice_mons_cmp); |
| 1776 | |
| 1777 | for (j = 0; j < i; j++) |
| 1778 | notice_mon(arr[j]); |
| 1779 | } |
| 1780 | |
| 1781 | free(arr); |
| 1782 | } |
| 1783 | } |
| 1784 | |
| 1785 | /* maybe disturb buried zombies when an object is dropped or thrown nearby */ |
| 1786 | void |
no test coverage detected