Skip to content

Commit

Permalink
npctalk/open_dialogue: clone actor instead of hacking it
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei8l committed Nov 8, 2024
1 parent bcb9ec3 commit 85500c9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/npctalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4958,16 +4958,8 @@ talk_effect_fun_t::func f_open_dialogue( const JsonObject &jo, std::string_view
} else if( !actual_topic.empty() ) {
get_avatar().talk_to( get_talker_for( std::vector<std::string> { actual_topic } ), false, false,
true );
} else if( d.actor( true )->get_character() != nullptr ) {
get_avatar().talk_to( get_talker_for( d.actor( true )->get_character() ) );
} else if( d.actor( true )->get_creature() != nullptr ) {
get_avatar().talk_to( get_talker_for( d.actor( true )->get_creature() ) );
} else if( d.actor( true )->get_monster() != nullptr ) {
get_avatar().talk_to( get_talker_for( d.actor( true )->get_monster() ) );
} else if( d.actor( true )->get_item() != nullptr ) {
get_avatar().talk_to( get_talker_for( d.actor( true )->get_item() ) );
} else if( d.actor( true )->get_computer() != nullptr ) {
get_avatar().talk_to( get_talker_for( d.actor( true )->get_computer() ), false, true );
} else {
get_avatar().talk_to( d.actor( true )->clone() );
}
run_eoc_vector( true_eocs, d );
};
Expand Down

0 comments on commit 85500c9

Please sign in to comment.