- fixed: Strife dialogues could crash on invalid links.

This commit is contained in:
Christoph Oelckers 2015-12-26 15:31:59 +01:00
parent beb7a8e4a2
commit 400038643c

View file

@ -1347,9 +1347,10 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
int rootnode = npc->ConversationRoot; int rootnode = npc->ConversationRoot;
if (reply->NextNode < 0) if (reply->NextNode < 0)
{ {
npc->Conversation = StrifeDialogues[rootnode - reply->NextNode - 1]; unsigned next = (unsigned)(rootnode - reply->NextNode - 1);
if (gameaction != ga_slideshow) if (gameaction != ga_slideshow && next < StrifeDialogues.Size())
{ {
npc->Conversation = StrifeDialogues[next];
P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false); P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false);
return; return;
} }