diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index a2c7b8bed..c1bbcf89c 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/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