diff --git a/gamebrain/gamedata/cache.py b/gamebrain/gamedata/cache.py index db285ca..874198c 100644 --- a/gamebrain/gamedata/cache.py +++ b/gamebrain/gamedata/cache.py @@ -2518,6 +2518,13 @@ def _find_comm_event_to_activate( cls, team_id: TeamID, team_data: InternalTeamGameData ): def is_relevant_task(global_task: InternalGlobalTaskData) -> bool: + # Check if the associated mission is even unlocked. + team_mission = team_data.missions.get(global_task.missionID) + if not team_mission: + return False + if not team_mission.unlocked: + return False + team_task = team_data.tasks.get(global_task.taskID) if not team_task: return False @@ -2525,6 +2532,7 @@ def is_relevant_task(global_task: InternalGlobalTaskData) -> bool: return False if team_task.complete: return False + completion_criteria = global_task.markCompleteWhen if not completion_criteria: return False