Skip to content

Commit

Permalink
Better handle importing leagues during a fantasy/expansion draft - pr…
Browse files Browse the repository at this point in the history
…eviously some settings from previous season could get messed up if they changed after the season
  • Loading branch information
dumbmatter committed Jan 13, 2025
1 parent c6cbc1a commit 699bbe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Add https://mail.google.com/mail/u/0/#inbox/FMfcgzQXKhJZvwmSjwbthGLcdXGfCrJH to rebuilding/contending strategy rewrite

Create league in 1949 playoffs. Sim through playoffs. Expansion draft starts. Export/import league. Observe that the playoff changes for 1950 got applied to 1949 https://mail.google.com/mail/u/0/#inbox/FMfcgzQZSZFWNRNfpsKFvnRmhWRHcttB

vector logo generation
- https://www.recraft.ai/ai-image-vectorizer
- https://sagipolaczek.github.io/NeuralSVG/
Expand Down
9 changes: 8 additions & 1 deletion src/worker/core/league/createStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,17 @@ const finalizeGameAttributes = async ({
};

for (const key of helpers.keys(gameAttributeOverrides)) {
let phase = finalized.phase ?? PHASE.PRESEASON;
if (phase < 0) {
if (finalized.nextPhase !== undefined) {
phase = finalized.nextPhase;
}
}

// If we're overriding a value with history, keep the history
finalized[key] = wrap(finalized, key, gameAttributeOverrides[key], {
season: finalized.season ?? startingSeason,
phase: finalized.phase ?? PHASE.PRESEASON,
phase,
});
}

Expand Down

0 comments on commit 699bbe8

Please sign in to comment.