Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dirty workaround for one crash in choose_deck_controller. #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion data/objects/choose_deck_controller.cfg
Expand Up @@ -147,7 +147,23 @@
]),
])
asserting deck_info != null | [deck.deck_name, keys(deck_choices), starter_decks_selected]
where deck_info = Deck|null :: deck_choices[deck.deck_name]
where deck_info = Deck | null :: if (
deck_choices[deck.deck_name] is not null,
deck_choices[deck.deck_name],
// else,
other_deck_choices[deck.deck_name]
)
// This `other_deck_choices` variable is a fail-safe in case
// the asserting operation would be going to fail.
// FIXME Make sure `starter_decks_selected` is always set to
// the proper value and so then this fail-safe variable may be
// safely removed.
where other_deck_choices = if (
not starter_decks_selected,
DeckMap <- lib.json.get_document_map('data/starting-decks.cfg'),
// else,
filter(title_controller.decks, not value.archived)
)
where deck_choices = if(starter_decks_selected, DeckMap<- lib.json.get_document_map('data/starting-decks.cfg'), filter(title_controller.decks, not value.archived))
where num_decks = size(filter(title_controller.decks, not value.archived))
",
Expand Down