$OpenBSD: patch-launch-game_sh,v 1.3 2021/05/12 13:52:49 patrick Exp $

Index: launch-game.sh
--- launch-game.sh.orig
+++ launch-game.sh
@@ -1,14 +1,21 @@
 #!/bin/sh
-if command -v python3 >/dev/null 2>&1; then
-	 MODLAUNCHER=$(python3 -c "import os; print(os.path.realpath('$0'))")
-else
-	 MODLAUNCHER=$(python -c "import os; print(os.path.realpath('$0'))")
-fi
+MODLAUNCHER=$(readlink -f $0)
 
 # Prompt for a mod to launch if one is not already specified
 MODARG=''
-if [ z"${*#*Game.Mod}" = z"$*" ]
-then
+
+ARGLIST="$@"
+while [ $# -gt 0 ]; do
+	case "$1" in
+		Game.Mod=*) 
+			break
+			;;
+		*)
+			;;
+	esac
+	shift
+done
+if [ $# -eq 0 ]; then
 	if command -v zenity > /dev/null
 	then
 		TITLE=$(zenity --forms --add-combo="" --combo-values="Red Alert|Tiberian Dawn|Dune 2000|Tiberian Sun" --text "Select mod" --title="" || echo "cancel")
@@ -25,7 +32,7 @@ then
 fi
 
 # Launch the engine with the appropriate arguments
-mono bin/OpenRA.exe Engine.EngineDir=".." Engine.LaunchPath="$MODLAUNCHER" $MODARG "$@"
+mono ${PREFIX}/share/openra/OpenRA.exe Engine.EngineDir=".." Engine.LaunchPath="$MODLAUNCHER" $MODARG "$@"
 
 # Show a crash dialog if something went wrong
 if [ $? != 0 ] && [ $? != 1 ]; then
