Fixed create_game_array function.

This commit is contained in:
Storm Dragon 2025-05-20 17:51:20 -04:00
parent d9ef202b33
commit 6526d40c68

View File

@ -278,10 +278,13 @@ process_launcher-flags() {
create_game_array() {
# Game array 0 bottle, 1 path, 2 title, 3+ flags
game="$1"
for i in "${lines[@]}" ; do
# Escape pipe characters in both strings for regex matching
if [[ "${i//|/\\|}" =~ ^${game//|/\\|}$ ]]; then
game="$i"
# Only compare the launcher section
j="${game#*|}"
k="${i#*|}"
k="${k%%|*}"
if [[ "$j" == "$k" ]]; then
IFS='|' read -ra game <<< "$i"
break
fi
@ -330,9 +333,9 @@ game_launcher() {
source .includes/help.sh # Make available in this function
documentation "$game" "$(echo "$game" | cut -d '|' -f2)"
fi
create_game_array
create_game_array "$game"
else
create_game_array
create_game_array "$game"
if [[ -z "$game" ]]; then
echo "Game $1 not found."
exit 1