From 29d020e15dde5d67e0e3d40384abfd95f890d89d Mon Sep 17 00:00:00 2001 From: DeathByDenim Date: Sun, 17 Sep 2023 08:26:06 -0400 Subject: [PATCH] Add kwadroke's maplist generator for FTEQW --- scripts/deploy_fteqw.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/scripts/deploy_fteqw.sh b/scripts/deploy_fteqw.sh index b5e09a4..ab53665 100755 --- a/scripts/deploy_fteqw.sh +++ b/scripts/deploy_fteqw.sh @@ -47,27 +47,37 @@ cd ${TMPDIR:-/tmp}/progs/fteqw/quakec/basemod /opt/fteqw/fteqcc64 cp qwprogs.dat /opt/fteqw/lq1 cd - +rm -rf ${TMPDIR:-/tmp}/progs + +if [ -e /opt/fteqw/lq1/maplist.cfg ]; then + ## Delete the current maplist.cfg file so that there is not double (or more) entries + rm /opt/fteqw/lq1/maplist.cfg +fi + +## Generate the map list +cd /opt/fteqw/lq1/maps +declare -a mapfiles=(lqdm*.bsp) +for (( i = 0; i < ${#mapfiles[*]}; ++ i )); do + ## Need to remove the .bsp from map name + echo serverinfo \"$(basename --suffix=.bsp "${mapfiles[$i-1]}")\" \"$(basename --suffix=.bsp "${mapfiles[$i]}")\" >> /opt/fteqw/lq1/maplist.cfg +done +cd - # Configuration based on https://gist.github.com/kwadroke/fa978290d86a606de3875fa853d79334 cat > /opt/fteqw/lq1/autoexec.cfg <