Skip to content

Commit

Permalink
Check if a task's mission is unlocked before activating a comm event.
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jvessella committed Feb 29, 2024
1 parent fd4c40a commit 404be19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gamebrain/gamedata/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2518,13 +2518,21 @@ 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
if not team_task.visible:
return False
if team_task.complete:
return False

completion_criteria = global_task.markCompleteWhen
if not completion_criteria:
return False
Expand Down

0 comments on commit 404be19

Please sign in to comment.