From 3b028e17178d196387267798db576633664ed3b9 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 30 Aug 2024 16:16:14 -0500 Subject: [PATCH] fix #418 --- src/game/boe.dlgutil.cpp | 54 ++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index 06bef20d..1f345124 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -565,30 +565,7 @@ void set_up_shop_array() { } } -void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short store_face_pic) { - rectangle area_rect; - - store_personality = personality; - - store_monst_type = monst_type; - store_m_num = m_num; - store_talk_face_pic = store_face_pic; //// - area_rect = talk_area_rect; - talk_gworld.create(area_rect.width(), area_rect.height()); - help_btn->show(); - - // This would be the place to show the text box, if I add it. - - // Set the current town for talk strings - univ.town.prep_talk(personality / 10); - - // Dredge up critter's name - title_string = std::string(univ.town.cur_talk().people[personality % 10].title) + ":"; - - store_pre_talk_mode = overall_mode; - overall_mode = MODE_TALKING; - talk_end_forced = false; - +static void reset_talk_words() { // first initialise talk_words here talk_words.clear(); static const rectangle preset_rects[9] = { @@ -622,6 +599,33 @@ void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short st } talk_words.push_back(preset_word); } +} + +void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short store_face_pic) { + rectangle area_rect; + + store_personality = personality; + + store_monst_type = monst_type; + store_m_num = m_num; + store_talk_face_pic = store_face_pic; //// + area_rect = talk_area_rect; + talk_gworld.create(area_rect.width(), area_rect.height()); + help_btn->show(); + + // This would be the place to show the text box, if I add it. + + // Set the current town for talk strings + univ.town.prep_talk(personality / 10); + + // Dredge up critter's name + title_string = std::string(univ.town.cur_talk().people[personality % 10].title) + ":"; + + store_pre_talk_mode = overall_mode; + overall_mode = MODE_TALKING; + talk_end_forced = false; + + reset_talk_words(); stat_screen_mode = MODE_SHOP; current_talk_node = TALK_LOOK; @@ -718,6 +722,8 @@ void handle_talk_node(int which_talk_entry) { if(which_talk_entry == TALK_DUNNO) return; + reset_talk_words(); + short get_pc,s1 = -1,s2 = -1; char asked[4];