From 85500c9e3694a41b2b04c5003cfcd2f316598c42 Mon Sep 17 00:00:00 2001 From: andrei Date: Fri, 1 Nov 2024 09:43:49 +0200 Subject: [PATCH] npctalk/open_dialogue: clone actor instead of hacking it --- src/npctalk.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/npctalk.cpp b/src/npctalk.cpp index ccecb7a4bb2ae..5d212a74f26a7 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -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 { 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 ); };