Skip to content

Commit

Permalink
improve checking logics in checkOptionalObjectiveAmountWinCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
sookmax committed Jun 17, 2024
1 parent 2b94409 commit 84b2ad6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apollo/lib/checkWinCondition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ function checkOptionalObjectiveAmountWinCondition(
for (const condition of winConditions) {
if (
condition.type === WinCriteria.OptionalObjectiveAmount &&
(!condition.players ||
condition.players.length === 0 ||
condition.players.includes(actionResponse.toPlayer)) &&
completedObjectiveCount >= condition.amount
) {
return condition;
Expand All @@ -339,7 +342,7 @@ function checkOptionalObjectiveAmountWinCondition(
} else if (
actionResponse.type === 'DeniedOptionalObjective' &&
actionResponse.condition.type !== WinCriteria.Default &&
actionResponse.condition.failed
actionResponse.condition.failed?.size
) {
for (const deniedPlayer of actionResponse.condition.failed) {
const viableObjectiveCount = winConditions.filter(
Expand Down

0 comments on commit 84b2ad6

Please sign in to comment.