diff --git a/.gitignore b/.gitignore index 3ce9b2f..1722461 100644 --- a/.gitignore +++ b/.gitignore @@ -346,4 +346,5 @@ weather_config.json ids # database -matteo.db \ No newline at end of file +matteo.db +/matteo_env/Lib/site-packages/flask_socketio/__init__.py diff --git a/games.py b/games.py index 2a75145..c692aa2 100644 --- a/games.py +++ b/games.py @@ -175,9 +175,12 @@ class game(object): batter = self.get_batter() if self.top_of_inning: - defender = random.choice(self.teams["home"].lineup) + defender_list = self.teams["home"].lineup.copy() else: - defender = random.choice(self.teams["away"].lineup) + defender_list = self.teams["away"].lineup.copy() + + defender_list.append(pitcher) + defender = random.choice(defender_list) #make pitchers field outcome["batter"] = batter outcome["defender"] = ""