topten.c comments
This commit is contained in:
+34
-1
@@ -1110,6 +1110,38 @@ score_wanted(
|
|||||||
if (sysopt.pers_is_uid && !playerct && t1->uid == uid)
|
if (sysopt.pers_is_uid && !playerct && t1->uid == uid)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME:
|
||||||
|
* This selection produces a union (OR) of criteria rather than
|
||||||
|
* an intersection (AND). So
|
||||||
|
* nethack -s -u igor -p Cav -r Hum
|
||||||
|
* will list all entries for name igor regardless of role or race
|
||||||
|
* plus all entries for cave dwellers regardless of name or race
|
||||||
|
* plus all entries for humans regardless of name or role.
|
||||||
|
*
|
||||||
|
* It would be more useful if it only chose human cave dwellers
|
||||||
|
* named igor. That would be pretty straightforward if only one
|
||||||
|
* instance of each of the criteria were possible, but
|
||||||
|
* nethack -s -u igor -u ayn -p Cav -p Pri -r Hum -r Dwa
|
||||||
|
* should list human cave dwellers named igor and human cave
|
||||||
|
* dwellers named ayn plus dwarven cave dwellers named igor and
|
||||||
|
* dwarven cave dwellers named ayn plus human priest[esse]s named
|
||||||
|
* igor and human priest[esse]s named ayn (the combination of
|
||||||
|
* dwarven priest[esse]s doesn't occur but the selection can test
|
||||||
|
* entries without being aware of such; it just won't find any
|
||||||
|
* matches for that). An extra initial pass of the command line
|
||||||
|
* to collect all criteria before testing any entry is needed to
|
||||||
|
* accomplish this. And we might need to drop support for
|
||||||
|
* pre-3.3.0 entries (old elf role) depending on how the criteria
|
||||||
|
* matching is performed.
|
||||||
|
*
|
||||||
|
* It also ought to extended to handle
|
||||||
|
* nethack -s -u igor-Cav-Hum
|
||||||
|
* Alignment and gender could be useful too but no one has ever
|
||||||
|
* clamored for them. Presumably if they care they postprocess
|
||||||
|
* with some custom tool.
|
||||||
|
*/
|
||||||
|
|
||||||
for (i = 0; i < playerct; i++) {
|
for (i = 0; i < playerct; i++) {
|
||||||
arg = players[i];
|
arg = players[i];
|
||||||
if (arg[0] == '-' && arg[1] == 'u' && arg[2] != '\0')
|
if (arg[0] == '-' && arg[1] == 'u' && arg[2] != '\0')
|
||||||
@@ -1193,7 +1225,8 @@ prscore(int argc, char **argv)
|
|||||||
} else { /* concatenated arg string; use up "-s" but keep argc,argv */
|
} else { /* concatenated arg string; use up "-s" but keep argc,argv */
|
||||||
argv[1] += 2;
|
argv[1] += 2;
|
||||||
}
|
}
|
||||||
/* -v doesn't take a version number arg; it means 'current vers only';
|
/* -v doesn't take a version number arg; it means 'all versions present
|
||||||
|
in the file' instead of the default of only the current version;
|
||||||
unlike -s, we don't accept "-v<anything>" for non-empty <anything> */
|
unlike -s, we don't accept "-v<anything>" for non-empty <anything> */
|
||||||
if (argc > 1 && !strcmp(argv[1], "-v")) {
|
if (argc > 1 && !strcmp(argv[1], "-v")) {
|
||||||
current_ver = FALSE;
|
current_ver = FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user