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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user