From 673ac1295ca5492f4d029968e7b881bb6a230a59 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 21 Jan 2016 15:53:35 +0200 Subject: [PATCH] Fixed broken 'closedialog' property in Strife dialogs See http://forum.zdoom.org/viewtopic.php?t=50524 --- src/p_conversation.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index a74b9bd18..7b7355181 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -1345,20 +1345,24 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply if (reply->NextNode != 0) { int rootnode = npc->ConversationRoot; - unsigned next = (unsigned)(rootnode + (reply->NextNode < 0 ? -1 : 1) * reply->NextNode - 1); + const bool isNegative = reply->NextNode < 0; + const unsigned next = (unsigned)(rootnode + (isNegative ? -1 : 1) * reply->NextNode - 1); if (next < StrifeDialogues.Size()) { npc->Conversation = StrifeDialogues[next]; - if (gameaction != ga_slideshow) + if (isNegative) { - P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false); - return; - } - else - { - S_StopSound (npc, CHAN_VOICE); + if (gameaction != ga_slideshow) + { + P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false); + return; + } + else + { + S_StopSound (npc, CHAN_VOICE); + } } } }