From 7d18d94f3e1b2e29adb12930249cc81c07968e28 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 27 Jun 2015 20:50:00 -0400 Subject: [PATCH] Fix talk nodes being deleted if cancelled while last on the list --- src/scenedit/scen.actions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index e7ac6272..5929ea04 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -497,9 +497,8 @@ static bool handle_rb_action(location the_point, bool option_hit) { } else { if(j == size_before) town->talking.talk_nodes.emplace_back(); - // TODO: Mustn't do this if the Create New button was clicked to make more nodes! Ditto with special nodes. - if(edit_talk_node(j) == town->talking.talk_nodes.size() - 1) - town->talking.talk_nodes.pop_back(); + if((j = edit_talk_node(j)) >= 0 && town->talking.talk_nodes[j].personality == -1) + town->talking.talk_nodes.erase(town->talking.talk_nodes.begin() + j); } start_dialogue_editing(size_before == town->talking.talk_nodes.size()); if(size_before > town->talking.talk_nodes.size())