From 5bcbe32ccf6db27c7055d05cc80f8b51b4f48db9 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Wed, 27 Dec 2023 00:32:15 +0000 Subject: [PATCH] Fix generating Native Steam Linux Runtime command when it is not installed Native games will crash if 'Steam Linux Runtime 1.0 (Scout)' is not installed, this is because SteamTinkerLaunch incorrectly tries to fall back to generating a wrong command and does not properly return the empty SLRCMD variable. This leads to generating the launch command incorrectly, as STL thinks the SLR is installed and is valid. To fix this, we do an extra check to ensure the Proton SLR command is only generated when we're using the Proton SLR, and which avoids us falling back on the Proton SLR codepath when NATIVE_SLRCMD is not set. It is incorrect to assume that because the NATIVE_SLRCMD is not set that we're using Proton, we should only fall back to using PROTON_SLRCMD if we actually set the PROTON_SLRCMD earlier. --- steamtinkerlaunch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 3a0a8552..b5d87b4c 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20231212-1" +PROGVERS="v14.0.20231227-1 (fix-native-slr-missing)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -20779,6 +20779,7 @@ function getRequireToolAppidPath { # Function to get SLR to append to game/program launch # Primarily used to set SLRCMD so it can be appended, but also sets the reaper command +# TODO: refactor to use early returns and less indentation where possible function setSLRReap { # This function has gotten a bit messy with all the override options, but these are used to allow setSLRReap to be re-used outside of regular game launches such as for Vortex. @@ -20881,9 +20882,15 @@ function setSLRReap { if [ -n "${NATIVE_SLRCMD[*]}" ]; then writelog "INFO" "${FUNCNAME[0]} - Building Steam Linux Runtime command for native game" SLRCMD=("${PROTON_SLRCMD[@]}" "${NATIVE_SLRCMD[@]}") # Not really "Proton" for native games, but naming is hard - else + elif [ -n "${PROTON_SLRCMD[*]}" ]; then writelog "INFO" "${FUNCNAME[0]} - Building Steam Linux Runtime command for Proton game" SLRCMD=("${PROTON_SLRCMD[@]}") + else + if [ "${REQUIRED_APPID}" = "${SLRAID}" ]; then # Assume native when REQUIRED_APPID is set to the native Linux SLRAID + writelog "WARN" "${FUNCNAME[0]} - No native linux Steam Linux Runtime found, game will not use Steam Linux Runtime" + else # If not native, can only be Proton + writelog "WARN" "${FUNCNAME[0]} - No Proton Steam Linux Runtime found, game will not use Steam Linux Runtime" + fi fi fi fi