fix round tie loop + improve tie ranking

This commit is contained in:
Maxime Réaux 2026-02-20 23:44:22 +01:00
parent 60d8e6ca15
commit f339498f97
6 changed files with 99 additions and 110 deletions

View file

@ -27,7 +27,8 @@ class ClosureService:
@staticmethod
def apply_battle_outcomes(war: War, campaign: Campaign, battle: Battle) -> None:
already_granted = any(
isinstance(e, InfluenceGained) and e.source == f"battle:{battle.sector_id}"
isinstance(e, InfluenceGained)
and e.context_id == f"battle:{battle.sector_id}"
for e in war.events
)
if already_granted:
@ -49,7 +50,8 @@ class ClosureService:
InfluenceGained(
participant_id=effective_winner,
amount=1,
source=f"battle:{battle.sector_id}",
context_type=ContextType.BATTLE,
context_id=f"battle:{battle.sector_id}",
)
)