BSPC="/opt/GtkRadiant-1.4/q3map2"
BASEPATH=$HOME
GAMEDIR="BlobAndConquer"
MAPDIR="data/bsp"

if [ ! -f "$BASEPATH/$GAMEDIR/$MAPDIR/$1.map" ]
then
echo "Map $BASEPATH/$GAMEDIR/$MAPDIR/$1.map does not exist. Check filename and script variables."
exit
fi

rm -f "$BASEPATH/$GAMEDIR/$MAPDIR/$1.bsp"

$BSPC -connect 127.0.0.1:39000 -threads 3 -fs_game $GAMEDIR -fs_basepath $BASEPATH -meta "$BASEPATH/$GAMEDIR/$MAPDIR/$1.map"
