From 673ac1295ca5492f4d029968e7b881bb6a230a59 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 21 Jan 2016 15:53:35 +0200 Subject: [PATCH 1/2] 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 a74b9bd18e..7b73551810 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); + } } } } From 598bccbe9347cb8065faf07711dc9240651bbf95 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 21 Jan 2016 15:53:58 +0200 Subject: [PATCH 2/2] Added warning when next dialog page is incorrect --- src/p_conversation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 7b73551810..ab6cf58835 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -1365,6 +1365,10 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply } } } + else + { + Printf ("Next node %u is invalid, no such dialog page\n", next); + } } npc->angle = player->ConversationNPCAngle;