From a8e5b90667392072eac633bc1f74f935aab8c37b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 15 Jan 2016 18:32:49 +0200 Subject: [PATCH] Fixed stuck Strife dialogs See http://forum.zdoom.org/viewtopic.php?t=50451 and http://forum.zdoom.org/viewtopic.php?t=48470 --- src/p_conversation.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index db5fd400c..a74b9bd18 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -1345,12 +1345,14 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply if (reply->NextNode != 0) { int rootnode = npc->ConversationRoot; - if (reply->NextNode < 0) + unsigned next = (unsigned)(rootnode + (reply->NextNode < 0 ? -1 : 1) * reply->NextNode - 1); + + if (next < StrifeDialogues.Size()) { - unsigned next = (unsigned)(rootnode - reply->NextNode - 1); - if (gameaction != ga_slideshow && next < StrifeDialogues.Size()) + npc->Conversation = StrifeDialogues[next]; + + if (gameaction != ga_slideshow) { - npc->Conversation = StrifeDialogues[next]; P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false); return; } @@ -1359,10 +1361,6 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply S_StopSound (npc, CHAN_VOICE); } } - else - { - npc->Conversation = StrifeDialogues[rootnode + reply->NextNode - 1]; - } } npc->angle = player->ConversationNPCAngle;