MCPcopy Create free account
hub / github.com/NetHack/NetHack / mon_chain

Function mon_chain

src/wizcmds.c:1256–1281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254}
1255
1256staticfn void
1257mon_chain(
1258 winid win,
1259 const char *src,
1260 struct monst *chain,
1261 boolean force,
1262 long *total_count, long *total_size)
1263{
1264 char buf[BUFSZ];
1265 long count, size;
1266 struct monst *mon;
1267 /* mon->wormno means something different for migrating_mons and mydogs */
1268 boolean incl_wsegs = !strcmpi(src, "fmon");
1269
1270 count = size = 0L;
1271 for (mon = chain; mon; mon = mon->nmon) {
1272 count++;
1273 size += size_monst(mon, incl_wsegs);
1274 }
1275 if (count || size || force) {
1276 *total_count += count;
1277 *total_size += size;
1278 Sprintf(buf, template, src, count, size);
1279 putstr(win, 0, buf);
1280 }
1281}
1282
1283staticfn void
1284misc_stats(

Callers 1

wiz_show_statsFunction · 0.85

Calls 1

size_monstFunction · 0.85

Tested by

no test coverage detected