@@ -796,7 +796,7 @@ def set_goals(self) -> None:
796796 trials = GoalCategory ('trials' , 30 , minimum_goals = 1 )
797797 th = GoalCategory ('triforce_hunt' , 30 , goal_count = round (self .settings .triforce_goal_per_world / 10 ), minimum_goals = 1 )
798798 ganon = GoalCategory ('ganon' , 40 , goal_count = 1 )
799- trial_goal = Goal (self , 'the Tower' , 'path to #the Tower#' , 'White' , items = [{ 'name' : 'Ganons Tower Access' , 'quantity' : 1 , 'minimum' : 1 , 'hintable' : True }] )
799+ trial_goal = Goal (self , 'the Tower' , 'path to #the Tower#' , 'White' , items = [], create_empty = True )
800800
801801 if self .settings .triforce_hunt and self .settings .triforce_goal_per_world > 0 :
802802 # "Hintable" value of False means the goal items themselves cannot
@@ -1023,7 +1023,13 @@ def set_goals(self) -> None:
10231023
10241024 # To avoid too many goals in the hint selection phase,
10251025 # trials are reduced to one goal with six items to obtain.
1026- if not self .settings .shuffle_ganon_tower :
1026+ if self .settings .shuffle_ganon_tower :
1027+ trial_goal .items .append ({'name' : 'Ganons Tower Access' , 'quantity' : 1 , 'minimum' : 1 , 'hintable' : True })
1028+ trial_goal .goal_count += 1
1029+
1030+ trials .add_goal (trial_goal )
1031+ self .goal_categories [trials .name ] = trials
1032+ else :
10271033 if not self .skipped_trials ['Forest' ]:
10281034 trial_goal .items .append ({'name' : 'Forest Trial Clear' , 'quantity' : 1 , 'minimum' : 1 , 'hintable' : True })
10291035 trials .goal_count += 1
@@ -1042,8 +1048,14 @@ def set_goals(self) -> None:
10421048 if not self .skipped_trials ['Light' ]:
10431049 trial_goal .items .append ({'name' : 'Light Trial Clear' , 'quantity' : 1 , 'minimum' : 1 , 'hintable' : True })
10441050 trials .goal_count += 1
1045- trials .add_goal (trial_goal )
1046- self .goal_categories [trials .name ] = trials
1051+
1052+ # Trials category is finalized and saved only if at least one trial is on
1053+ # If random trials are on and one world in multiworld gets 0 trials, still
1054+ # add the goal to prevent key errors. Since no items fulfill the goal, it
1055+ # will always be invalid for that world and not generate hints.
1056+ if self .settings .trials > 0 or self .settings .trials_random :
1057+ trials .add_goal (trial_goal )
1058+ self .goal_categories [trials .name ] = trials
10471059
10481060 # In glitched logic or if trials are off, it's possible that some items required to beat the game
10491061 # (such as bow, magic, light arrows, or anything required to reach Ganon's Castle)
0 commit comments