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

Function classmon

src/topten.c:1355–1375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355staticfn int
1356classmon(char *plch)
1357{
1358 int i;
1359
1360 /* Look for this role in the role table */
1361 for (i = 0; roles[i].name.m; i++) {
1362 if (!strncmp(plch, roles[i].filecode, ROLESZ)) {
1363 if (roles[i].mnum != NON_PM)
1364 return roles[i].mnum;
1365 else
1366 return PM_HUMAN;
1367 }
1368 }
1369 /* this might be from a 3.2.x score for former Elf class */
1370 if (!strcmp(plch, "E"))
1371 return PM_RANGER;
1372
1373 impossible("What weird role is this? (%s)", plch);
1374 return PM_HUMAN_MUMMY;
1375}
1376
1377/*
1378 * Get a random player name and class from the high score list,

Callers 2

tt_onameFunction · 0.85
tt_doppelFunction · 0.85

Calls 1

impossibleFunction · 0.70

Tested by

no test coverage detected