Przeglądaj źródła

Checks done differently

UltimateByte 9 lat temu
rodzic
commit
5c8b59db19
1 zmienionych plików z 14 dodań i 1 usunięć
  1. 14 1
      lgsm/functions/command_mods_install.sh

+ 14 - 1
lgsm/functions/command_mods_install.sh

@@ -43,6 +43,19 @@ fn_mods_install_init(){
 	fn_script_log "Installing ${modprettyname}."
 }
 
+fn_mods_requirements(){
+	# If systemdir doesn't exist, then the game isn't installed
+	if [ ! -d "${systemdir}" ]; then
+		fn_print_fail "${gamename} needs to be installed first."
+		core_exit.sh
+	# If tompdir variable doesn't exist, LGSM is too old
+	elif [ -z "${tmpdir}" ]||[ -z "${lgsmdir}" ]; then
+		fn_print_fail "Your LGSM version is too old."
+		echo " * Please do a full update, including ${selfname} script."
+		core_exit.sh
+	fi
+}
+
 # Create mods directory if it doesn't exist
 # Assuming the game is already installed as mods_list.sh checked for it.
 fn_mods_dir(){
@@ -170,6 +183,6 @@ fn_mod_installation(){
 	fi
 }
 
-fn_mods_install_checks
+fn_mods_requirements
 fn_mods_install_init
 fn_mod_installation