MCPcopy Index your code
hub / github.com/NetHack/NetHack / init_mongen_order

Function init_mongen_order

src/makemon.c:1806–1828  ·  view source on GitHub ↗

initialize monster order for mkclass */

Source from the content-addressed store, hash-verified

1804
1805/* initialize monster order for mkclass */
1806staticfn void
1807init_mongen_order(void)
1808{
1809 int i, mlet;
1810
1811 if (mongen_order_init)
1812 return;
1813
1814 mongen_order_init = TRUE;
1815 for (i = LOW_PM; i < NUMMONS; i++) {
1816 mongen_order[i] = i;
1817 mlet = mons[i].mlet;
1818 if ((xint8) (mons[i].geno & G_FREQ) > mclass_maxf[mlet])
1819 mclass_maxf[mlet] = (xint8) (mons[i].geno & G_FREQ);
1820 }
1821#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
1822 check_mongen_order();
1823#endif
1824 qsort((genericptr_t) mongen_order, SPECIAL_PM, sizeof(int), cmp_init_mongen_order);
1825#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
1826 check_mongen_order();
1827#endif
1828}
1829
1830#define MONSi(i) (mongen_order[i])
1831

Callers 2

dump_mongenFunction · 0.85
mkclass_alignedFunction · 0.85

Calls 2

check_mongen_orderFunction · 0.85
qsortFunction · 0.85

Tested by

no test coverage detected