diff --git a/src/mutation_ui.cpp b/src/mutation_ui.cpp index 0cb6c03d2c71a..d453fffc2e3b8 100644 --- a/src/mutation_ui.cpp +++ b/src/mutation_ui.cpp @@ -49,14 +49,14 @@ static const auto shortcut_desc = []( const std::string_view comment, const std: // needs extensive improvement -static trait_id GetTrait( const std::vector &active, - const std::vector &passive, - int cursor, mutation_tab_mode tab_mode ) +static std::optional GetTrait( const std::vector &active, + const std::vector &passive, + int cursor, mutation_tab_mode tab_mode ) { - trait_id mut_id; + std::optional mut_id; if( tab_mode == mutation_tab_mode::active ) { mut_id = active[cursor]; - } else { + } else if( tab_mode == mutation_tab_mode::passive ) { mut_id = passive[cursor]; } return mut_id;