add MAXPLAYERS to SYSCF (trunk only)

Add MAXPLAYERS to SYSCF config file; deprecate (but continue to support)
 MAX_NR_OF_PLAYERS in nethack.sh since it is trivially overridden in many
 (all?) cases and isn't useful for ports that don't use nethack.sh.
This commit is contained in:
keni
2008-04-07 22:27:18 +00:00
parent 47d1eea0dd
commit 97abafd41a
7 changed files with 28 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
#include "hack.h"
#include "dlb.h"
#include <ctype.h>
#include <sys/stat.h>
#include <signal.h>
#include <pwd.h>
@@ -373,12 +374,20 @@ char *argv[];
}
}
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS. Make
* an error in next release. */
if(argc > 1)
locknum = atoi(argv[1]);
#ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */
if(!locknum || locknum > MAX_NR_OF_PLAYERS)
locknum = MAX_NR_OF_PLAYERS;
#endif
#ifdef SYSCF
/* let syscf override compile-time limit */
if(!locknum || (sysopt.maxplayers && locknum > sysopt.maxplayers))
locknum = sysopt.maxplayers;
#endif
}
#ifdef CHDIR