From f3b1cc74c6eccda4d2f20662b05ec2a80fd15054 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 14 Dec 2016 16:45:06 +0200 Subject: [PATCH] Set max players in sysconf, not in the shell script --- sys/unix/nethack.sh | 11 +---------- sys/unix/unixmain.c | 8 ++++++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh index 47d0da861..eec1991d6 100755 --- a/sys/unix/nethack.sh +++ b/sys/unix/nethack.sh @@ -4,8 +4,6 @@ HACKDIR=/usr/games/lib/nethackdir export HACKDIR HACK=$HACKDIR/nethack -# NB: MAXNROFPLAYERS is deprecated in favor of MAXPLAYERS in SYSCF. -MAXNROFPLAYERS=4 # Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH case "x$XUSERFILESEARCHPATH" in @@ -65,11 +63,4 @@ fi cd $HACKDIR -case $1 in - -s*) - exec $HACK "$@" - ;; - *) - exec $HACK "$@" $MAXNROFPLAYERS - ;; -esac +exec $HACK "$@" diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 2d6452ce8..1c0d55f90 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -419,10 +419,14 @@ char *argv[]; } } - /* XXX This is deprecated in favor of SYSCF with MAXPLAYERS. Make - * an error in next release. */ +#ifdef SYSCF + if (argc > 1) + raw_printf("MAXPLAYERS are set in sysconf file.\n"); +#else + /* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */ if (argc > 1) locknum = atoi(argv[1]); +#endif #ifdef MAX_NR_OF_PLAYERS /* limit to compile-time limit */ if (!locknum || locknum > MAX_NR_OF_PLAYERS)