Add MAX_STATUENAME_RANK sysconf setting

MAX_STATUENAME_RANK tells how many score file entries to use
for random statue names.
This commit is contained in:
Pasi Kallinen
2015-03-11 19:56:34 +02:00
parent 3243b332a3
commit a335f8306f
6 changed files with 17 additions and 1 deletions

View File

@@ -2209,6 +2209,13 @@ int src;
return 0;
}
sysopt.pointsmin = n;
} else if (src == SET_IN_SYS && match_varname(buf, "MAX_STATUENAME_RANK", 10)) {
n = atoi(bufp);
if (n < 1) {
raw_printf("Illegal value in MAX_STATUENAME_RANK (minimum is 1).");
return 0;
}
sysopt.tt_oname_maxrank = n;
# ifdef PANICTRACE
} else if (src == SET_IN_SYS &&
match_varname(buf, "PANICTRACE_LIBC", 15)) {

View File

@@ -29,6 +29,7 @@ sys_early_init(){
sysopt.entrymax = ENTRYMAX;
sysopt.pointsmin = POINTSMIN;
sysopt.pers_is_uid = PERS_IS_UID;
sysopt.tt_oname_maxrank = 10;
/* sanity checks */
if(PERSMAX<1) sysopt.persmax = 1;

View File

@@ -975,7 +975,7 @@ struct obj *otmp;
}
tt = &tt_buf;
rank = rnd(10);
rank = rnd(sysopt.tt_oname_maxrank);
pickentry:
for(i = rank; i; i--) {
readentry(rfile, tt);