Skip to content

Commit

Permalink
tournament: make sure you really always play at home
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Feb 13, 2024
1 parent cf5287e commit 1708216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions game/src/global/Global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ func create_quarter_finals() -> void:
matches.append({"home": groups[1][0],"away":groups[2][1], "result":":"})
matches.append({"home": groups[2][0],"away":groups[3][1], "result":":"})
matches.append({"home": groups[3][0],"away":groups[0][1], "result":":"})

# make sure you play always at home
for i in range(-5, -1, 1):
if matches[i]["away"]["name"] == selected_squad:
for i in range(matches.size(), 0, -1):
if "result" == ":" and matches[i]["away"]["name"] == selected_squad:
matches[i] = {"home": matches[i]["away"],"away":matches[i]["home"], "result":":"}
break # finished for sure

Expand Down
1 change: 1 addition & 0 deletions game/src/ui/pause/Pause.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func _on_Menu_pressed() -> void:
Global.music_loop.fade_in()
Global.click()
if not Global.current_league_game.empty():
# Global.game_over(5,0)
Global.game_over(0,5)
get_tree().paused = false
get_tree().change_scene("res://src/ui/menu/MenuScreen.tscn")
Expand Down

0 comments on commit 1708216

Please sign in to comment.