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

Function dev_name

src/mplayer.c:43–69  ·  view source on GitHub ↗

return a randomly chosen developer name */

Source from the content-addressed store, hash-verified

41
42/* return a randomly chosen developer name */
43staticfn const char *
44dev_name(void)
45{
46 int i, m = 0, n = SIZE(developers);
47 struct monst *mtmp;
48 boolean match;
49
50 do {
51 match = FALSE;
52 i = rn2(n);
53 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
54 if (!is_mplayer(mtmp->data))
55 continue;
56 if (!strncmp(developers[i],
57 (has_mgivenname(mtmp)) ? MGIVENNAME(mtmp) : "",
58 strlen(developers[i]))) {
59 match = TRUE;
60 break;
61 }
62 }
63 m++;
64 } while (match && m < 100); /* m for insurance */
65
66 if (match)
67 return (const char *) 0;
68 return (developers[i]);
69}
70
71staticfn void
72get_mplname(struct monst *mtmp, char *nam)

Callers 1

get_mplnameFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected