From 5430c20bea97df8a8d50518ed77491b6319f56b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Thu, 30 Mar 2023 15:28:13 +0200 Subject: [PATCH] Remove unused variable and function $proton and checkIfGameRunning() are not referenced anywhere else in the repository let alone this script. $LAUNCHED is toggled but the variable is never used in any checks. --- CE.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CE.sh b/CE.sh index c7853b3..6e3a91b 100755 --- a/CE.sh +++ b/CE.sh @@ -28,7 +28,6 @@ steamInstall="/home/$USER/.steam/" CEPrefix="/home/$USER/.wine" # Here's some flags you can tweak, although IIRC, ESync and FSync are required for Cheat Engine to function. -proton=$2 export WINEESYNC=1 export WINEFSYNC=1 export PROTON_FORCE_LARGE_ADDRESS_AWARE=1 @@ -42,7 +41,6 @@ read -p 'Enter a Steam AppID: ' STEAMAPPID # Don't mess with these variables, as they are necessary for this script to function. TIMES_TRIED=0 -LAUNCHED=0 # Sets the WinePrefix to the Proton prefix for said game. export WINEPREFIX="$prefixInstall/steamapps/compatdata/$STEAMAPPID/pfx" @@ -58,7 +56,6 @@ function checkProcess() sleep 10 # Sleeps the rest for ten seconds to let the game have some time to launch. # Starts Cheat Engine using the currently used Proton prefix. "$steamInstall/steam/steamapps/common/$PROTONVERSIONNAME/$PROTONSUBDIRECTORYNAME/bin/wine" "$CEPrefix/drive_c/Program Files/Cheat Engine $CEVersion/cheatengine-x86_64.exe" - $LAUNCHED == 1 else TIMES_TRIED=$(( TIMES_TRIED + 1)) # Adds a try to the amount of tries that have been done. if [$TIMES_TRIED = 1] @@ -71,18 +68,6 @@ function checkProcess() fi } -function checkIfGameRunning() -{ - if (( TIMES_TRIED < 5 )) # Checks if there's less than five tries. - then - checkProcess # Checks the process again. - else - echo "ERROR # 3: Game did not launch on time. Exiting." # Gives up, as something clearly went wrong. - sleep 3 # gives the batch script three seconds before returning the function. - return - fi -} - if [ -d "$WINEPREFIX" ] then if [ -d "$steamInstall/steam/steamapps/common/$PROTONVERSIONNAME/$PROTONSUBDIRECTORYNAME/" ]