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

Function init_blstats

src/botl.c:1758–1788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1756}
1757
1758staticfn void
1759init_blstats(void)
1760{
1761 static boolean initalready = FALSE;
1762 int i, j;
1763
1764 if (initalready) {
1765 impossible("init_blstats called more than once.");
1766 return;
1767 }
1768 for (i = 0; i <= 1; ++i) {
1769 for (j = 0; j < MAXBLSTATS; ++j) {
1770#ifdef STATUS_HILITES
1771 struct hilite_s *keep_hilite_chain = gb.blstats[i][j].thresholds;
1772#endif
1773
1774 gb.blstats[i][j] = initblstats[j];
1775 gb.blstats[i][j].a = cg.zeroany;
1776 if (gb.blstats[i][j].valwidth) {
1777 gb.blstats[i][j].val
1778 = (char *) alloc(gb.blstats[i][j].valwidth);
1779 gb.blstats[i][j].val[0] = '\0';
1780 } else
1781 gb.blstats[i][j].val = (char *) 0;
1782#ifdef STATUS_HILITES
1783 gb.blstats[i][j].thresholds = keep_hilite_chain;
1784#endif
1785 }
1786 }
1787 initalready = TRUE;
1788}
1789
1790/*
1791 * This compares the previous stat with the current stat,

Callers 1

status_initializeFunction · 0.85

Calls 2

impossibleFunction · 0.70
allocFunction · 0.70

Tested by

no test coverage detected