Skip to content

Commit

Permalink
Fix mutation examine window crash (#71410)
Browse files Browse the repository at this point in the history
* Fix mutation examine window crash

Fixes #71237

* Apply suggestions from code review

Style fixes

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and Procyonae committed May 20, 2024
1 parent e8f7249 commit c030a0c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mutation_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<trait_id> &active,
const std::vector<trait_id> &passive,
int cursor, mutation_tab_mode tab_mode )
static std::optional<trait_id> GetTrait( const std::vector<trait_id> &active,
const std::vector<trait_id> &passive,
int cursor, mutation_tab_mode tab_mode )
{
trait_id mut_id;
std::optional<trait_id> 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;
Expand Down

0 comments on commit c030a0c

Please sign in to comment.