Fix UB with optionals

This commit is contained in:
Nikita Lisitsa 2026-07-07 12:00:08 +03:00
parent 480a087d8e
commit 18a0676f16

View file

@ -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_))
{