From a3b9f5a943aa2085f14ce77e5ae8d83230eee981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20R=C3=A9aux?= Date: Mon, 16 Mar 2026 17:27:51 +0100 Subject: [PATCH] fix compute score of war participants absent from campaign --- src/warchron/model/score_service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/warchron/model/score_service.py b/src/warchron/model/score_service.py index f061729..40b0891 100644 --- a/src/warchron/model/score_service.py +++ b/src/warchron/model/score_service.py @@ -44,11 +44,17 @@ class ScoreService: ) -> Dict[str, ParticipantScore]: from warchron.model.result_checker import ResultChecker + if context_type == ContextType.CAMPAIGN: + camp = war.get_campaign(context_id) + camp_pids = camp.get_all_campaign_participants_ids() + participant_ids = [(camp.campaign_to_war_part_id(pid)) for pid in camp_pids] + elif context_type == ContextType.WAR: + participant_ids = war.get_all_war_participants_ids() scores = { pid: ParticipantScore( narrative_points={obj_id: 0 for obj_id in war.objectives} ) - for pid in war.participants + for pid in participant_ids } battles = ScoreService._get_battles_for_context(war, context_type, context_id) for battle in battles: