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

Function contained_stats

src/wizcmds.c:1198–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196}
1197
1198staticfn void
1199contained_stats(
1200 winid win,
1201 const char *src,
1202 long *total_count, long *total_size)
1203{
1204 char buf[BUFSZ];
1205 long count = 0, size = 0;
1206 struct monst *mon;
1207
1208 count_obj(gi.invent, &count, &size, FALSE, TRUE);
1209 count_obj(fobj, &count, &size, FALSE, TRUE);
1210 count_obj(svl.level.buriedobjlist, &count, &size, FALSE, TRUE);
1211 count_obj(gm.migrating_objs, &count, &size, FALSE, TRUE);
1212 /* DEADMONSTER check not required in this loop since they have no
1213 * inventory */
1214 for (mon = fmon; mon; mon = mon->nmon)
1215 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
1216 for (mon = gm.migrating_mons; mon; mon = mon->nmon)
1217 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
1218
1219 if (count || size) {
1220 *total_count += count;
1221 *total_size += size;
1222 Sprintf(buf, template, src, count, size);
1223 putstr(win, 0, buf);
1224 }
1225}
1226
1227staticfn int
1228size_monst(struct monst *mtmp, boolean incl_wsegs)

Callers 1

wiz_show_statsFunction · 0.85

Calls 1

count_objFunction · 0.85

Tested by

no test coverage detected