fix badly canceled tie-break series

This commit is contained in:
Maxime Réaux 2026-03-06 15:48:35 +01:00
parent 72f80563f1
commit 9b28e85557
4 changed files with 4 additions and 5 deletions

View file

@ -60,6 +60,7 @@ class CampaignController:
vp_icon_map = RankingIcon.compute_icons(
war, ContextType.CAMPAIGN, campaign_id, scores
)
# TODO get only objectives used in major/minor (ignore token only)
for obj in war.get_all_objectives():
objective_icon_maps[obj.id] = RankingIcon.compute_icons(
war,
@ -194,7 +195,6 @@ class CampaignController:
context_name=objective.name,
)
if not dialog.exec():
# FIXME lost tokens used for narrative tie-break (ContextType.OBJECTIVE)
TieResolver.cancel_tie_break(war, ctx)
raise ForbiddenOperation("Tie resolution cancelled")
bids_map[ctx.key()] = dialog.get_bids()

View file

@ -44,6 +44,7 @@ class CampaignClosureWorkflow(ClosureWorkflow):
TieResolver.apply_bids(war, tie, bids)
TieResolver.resolve_tie_state(war, tie, bids)
ties = TieResolver.find_campaign_ties(war, campaign.id)
# TODO get only objectives used in major/minor (ignore token only)
for objective_id in war.objectives:
ties = TieResolver.find_campaign_objective_ties(
war,
@ -76,6 +77,7 @@ class WarClosureWorkflow(ClosureWorkflow):
TieResolver.apply_bids(war, tie, bids)
TieResolver.resolve_tie_state(war, tie, bids)
ties = TieResolver.find_war_ties(war)
# TODO get only objectives used in major/minor (ignore token only)
for objective_id in war.objectives:
ties = TieResolver.find_war_objective_ties(
war,

View file

@ -60,6 +60,7 @@ class WarController:
vp_icon_map = RankingIcon.compute_icons(
war, ContextType.WAR, war_id, scores
)
# TODO get only objectives used in major/minor (ignore token only)
for obj in war.get_all_objectives():
objective_icon_maps[obj.id] = RankingIcon.compute_icons(
war,
@ -185,7 +186,6 @@ class WarController:
context_name=f"Objective tie: {objective.name}",
)
if not dialog.exec():
# FIXME lost tokens used for narrative tie-break (ContextType.OBJECTIVE)
TieResolver.cancel_tie_break(war, ctx)
raise ForbiddenOperation("Tie resolution cancelled")
bids_map[ctx.key()] = dialog.get_bids()

View file

@ -276,7 +276,6 @@ class TieResolver:
)
)
# FIXME lost tokens used for narrative tie-break (ContextType.OBJECTIVE)
@staticmethod
def cancel_tie_break(
war: War,
@ -295,8 +294,6 @@ class TieResolver:
isinstance(ev, TieResolved)
and ev.context_type == context.context_type
and ev.context_id == context.context_id
and ev.score_value == context.score_value
and ev.objective_id == context.objective_id
)
)
]