Skip to content

Commit

Permalink
npctalk: avoid dynamic_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
hexagonrecursion authored Feb 24, 2022
1 parent f2c025d commit 2c5f541
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/npctalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ std::vector<int> npcs_select_menu( const std::vector<T *> &npc_list,
entry = "* ";
}
bool enable = exclude_func == nullptr || !exclude_func( npc_list[i] );
if( const npc *np = dynamic_cast<const npc *>( npc_list[i] ) ) {
entry += np->name_and_activity();
} else {
entry += npc_list[i]->disp_name( false, true );
}
entry += npc_list[i]->name_and_maybe_activity();
nmenu.addentry( i, enable, MENU_AUTOASSIGN, entry );
}
nmenu.addentry( npc_count, true, MENU_AUTOASSIGN, _( "Finish selection" ) );
Expand Down

0 comments on commit 2c5f541

Please sign in to comment.