Skip to content

Commit

Permalink
misc: Fix commands being interpreted as game launch if command includ…
Browse files Browse the repository at this point in the history
…ed 'steamapps/common'
  • Loading branch information
sonic2kk committed Jun 16, 2024
1 parent 798feb0 commit 41283f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240616-3"
PROGVERS="v14.0.20240617-1 (fix-gamelaunch-steamappscommon)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -26751,6 +26751,7 @@ function main {
writelog "INFO" "${FUNCNAME[0]} - No arguments provided. See '$PROGCMD --help' for possible command line parameters" "E"
else
writelog "INFO" "${FUNCNAME[0]} - Checking command line: incoming arguments '${*}'"
writelog "INFO" "${FUNCNAME[0]} - Checking command line: first argument '${1}'"

if [ -n "$SteamAppId" ] && [ "$SteamAppId" -eq "0" ]; then
if grep -q "\"$1\"" <<< "$(sed -n "/^#STARTCMDLINE/,/^#ENDCMDLINE/p;/^#ENDCMDLINE/q" "$0" | grep if)"; then
Expand All @@ -26769,6 +26770,10 @@ function main {
elif grep -q "$SAC" <<< "$@" || grep -q "$L2EA" <<< "$@"; then
if grep -q "update" <<< "$@" || grep -q "^play" <<< "$@" ; then
commandline "$@"
# HACK: Since we check for steamapps/common ($SAC), commands which contain this (such as a one-time run path) will incorrectly get triggered as a game launch
# As a workaround, skip a hardcoded set of commands and pass directly to commandline (i.e. if we have OTR as our first option, pass down to commandline function and run otr)
elif grep -qE "otr|onetimerun" <<< "${1}"; then
commandline "$@"
else
setGameVars "$@"
if [ "$ISGAME" -eq 2 ] || [ "$ISGAME" -eq 3 ]; then
Expand Down

0 comments on commit 41283f0

Please sign in to comment.