Commit 08b3c57b authored by user472393's avatar user472393
Browse files

clean up mode_select. starting to quash bug which ends match prematurely

parent bc331108
......@@ -504,6 +504,7 @@ racer () {
mode_select "$loser"
tv_updater
sleep 1
if [[ "$g1loser" != "$loser" ]]; then
# cannot repick a mode unless you have lost it
if [[ "${mode_record[0]}" != "${mode_record[1]}" ]]; then
......@@ -537,40 +538,40 @@ mode_select () {
if tail -n 1 "$channel" | grep -i "$1"; then
check=$(tail -n 1 "$channel" | awk '{print $NF}' )
for entry in "${!modes[@]}"; do
if [[ "${modes[entry]}" == "$check" ]] \
&& (( ${#modes[@]} > 3 )); then
if [[ "${modes[entry]}" == "$check" ]]; then
if (( ${#modes[@]} > 3 )); then
unset -v modes["$entry"]
break 2
else
printer ">>> @$p1 (${elo_db[$p1]%.*}) vs. @$p2 (${elo_db[$p2]%.*}) in $ask ${modes[entry]}" "$p1 !won <<or>> $p1 !lost"
$tv_titler -m "${modes[entry]}"
mode_record+=("${!modes[entry]}")
modes[entry]=">>>${modes[entry]}"
tv_updater
modes[entry]="${modes[entry]##*>}"
sleep 2
result_check
break 2
fi
fi
done
fi
done
else
while read -r check ; do
for entry in "${!modes[@]}"; do
if [[ "${modes[entry]}" == "$check" ]]; then
if (( ${#modes[@]} > 3 )); then
unset -v modes["$entry"]
break 2
elif [[ "${modes[entry]}" == "$check" ]] \
&& (( ${#modes[@]} <= 3 )); then
else
printer ">>> @$p1 (${elo_db[$p1]%.*}) vs. @$p2 (${elo_db[$p2]%.*}) in $ask ${modes[entry]}" "$p1 !won <<or>> $p1 !lost"
$tv_titler -m "${modes[entry]}"
modes[entry]=">>>${modes[entry]}"
tv_updater
modes[entry]="${modes[entry]##*>}"
mode_record+=("${!modes[entry]}")
sleep 2
result_check
break 2
fi
done
fi
done
else
while read -r check ; do
for entry in "${!modes[@]}"; do
if [[ "${modes[entry]}" == "$check" ]] \
&& (( ${#modes[@]} > 3 )); then
unset -v modes["$entry"]
break 2
elif [[ "${modes[entry]}" == "$check" ]] \
&& (( ${#modes[@]} <= 3 )); then
printer ">>> @$p1 (${elo_db[$p1]%.*}) vs. @$p2 (${elo_db[$p2]%.*}) in $ask ${modes[entry]}" "$p1 !won <<or>> $p1 !lost"
$tv_titler -m "${modes[entry]}"
mode_record+=("${!modes[entry]}")
sleep 2
result_check
break 2
fi
done
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment