Просмотр исходного кода

refactor(details): change gamedig vars to unset if required

Daniel Gibbs 7 лет назад
Родитель
Сommit
1ba7e7121e
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      lgsm/functions/query_gamedig.sh

+ 6 - 6
lgsm/functions/query_gamedig.sh

@@ -89,37 +89,37 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 		# server name
 		gdname=$(echo "${gamedigraw}" | jq -re '.name')
 		if [ "${gdname}" == "null" ]; then
-			gdname=
+			unset gdname
 		fi
 
 		# numplayers
 		gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length')
 		if [ "${gdplayers}" == "null" ]; then
-			gdplayers=
+			unset gdplayers
 		fi
 
 		# maxplayers
 		gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length')
 		if [ "${gdmaxplayers}" == "null" ]; then
-			maxplayers=
+			unset maxplayers
 		fi
 
 		# current map
 		gdmap=$(echo "${gamedigraw}" | jq -re '.map')
 		if [ "${gdmap}" == "null" ]; then
-			gdmap=
+			unset gdmap
 		fi
 
 		# current gamemode
 		gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s')
 		if [ "${gdgamemode}" == "null" ]; then
-			gdgamemode=
+			unset gdgamemode
 		fi
 
 		# numbots
 		gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots')
 		if [ "${gdbots}" == "null" ]; then
-			gdbots=
+			unset gdbots
 		fi
 	fi
 fi