Fix UB with optionals
This commit is contained in:
parent
480a087d8e
commit
18a0676f16
1 changed files with 2 additions and 2 deletions
|
|
@ -2290,7 +2290,7 @@ namespace gmtk
|
|||
|
||||
if (selected_card_ || active_card_)
|
||||
{
|
||||
if (auto type = card_to_transformer(selected_card_.value_or(*active_card_)))
|
||||
if (auto type = card_to_transformer(selected_card_ ? *selected_card_ : *active_card_))
|
||||
shown_recipies = *type;
|
||||
}
|
||||
else if (selected_)
|
||||
|
|
@ -2376,7 +2376,7 @@ namespace gmtk
|
|||
}
|
||||
|
||||
if (selected_card_ || active_card_)
|
||||
helper_text = card_description(selected_card_.value_or(*active_card_));
|
||||
helper_text = card_description(selected_card_ ? *selected_card_ : *active_card_);
|
||||
else if (selected_)
|
||||
if (auto entity = map_.world->index<index>().find(*selected_))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue