fix compute score of war participants absent from campaign
This commit is contained in:
parent
241e76c937
commit
a3b9f5a943
1 changed files with 7 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue