From 6685238a62c61115b9f3dce792d52e87392cb1dd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 20 Feb 2019 19:12:32 +0100 Subject: [PATCH] - fixed string checks in dialogue loader. --- src/p_conversation.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 22ac48b3d..fdaf8585c 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -377,7 +377,7 @@ static FStrifeDialogueNode *ReadRetailNode (const char *name, FileReader &lump, if (name) { FStringf label("$TXT_DLG_%s_d%d_%s", name, int(pos), TokenFromString(speech.Dialogue).GetChars()); - node->Dialogue = GStrings.exists(label)? label : FString(speech.Dialogue); + node->Dialogue = GStrings.exists(label.GetChars()+1)? label : FString(speech.Dialogue); } else { @@ -401,7 +401,7 @@ static FStrifeDialogueNode *ReadRetailNode (const char *name, FileReader &lump, label.ReplaceChars(' ', '_'); label.ReplaceChars('\'', '_'); node->SpeakerName.Format("$TXT_SPEAKER_%s", label.GetChars()); - if (!GStrings.exists(node->SpeakerName)) node->SpeakerName = speech.Name; + if (!GStrings.exists(node->SpeakerName.GetChars() + 1)) node->SpeakerName = speech.Name; } else @@ -473,7 +473,7 @@ static FStrifeDialogueNode *ReadTeaserNode (const char *name, FileReader &lump, if (name) { FStringf label("$TXT_DLG_%s_d%d_%s", name, pos, TokenFromString(speech.Dialogue).GetChars()); - node->Dialogue = GStrings.exists(label)? label : FString(speech.Dialogue); + node->Dialogue = GStrings.exists(label.GetChars() + 1)? label : FString(speech.Dialogue); } else { @@ -502,7 +502,7 @@ static FStrifeDialogueNode *ReadTeaserNode (const char *name, FileReader &lump, label.ReplaceChars(' ', '_'); label.ReplaceChars('\'', '_'); node->SpeakerName.Format("$TXT_SPEAKER_%s", label.GetChars()); - if (!GStrings.exists(node->SpeakerName)) node->SpeakerName = speech.Name; + if (!GStrings.exists(node->SpeakerName.GetChars() + 1)) node->SpeakerName = speech.Name; } else { @@ -599,7 +599,7 @@ static void ParseReplies (const char *name, int pos, FStrifeDialogueReply **repl if (name) { FStringf label("$TXT_RPLY%d_%s_d%d_%s", j, name, pos, TokenFromString(rsp->Reply).GetChars()); - reply->Reply = GStrings.exists(label)? label : FString(rsp->Reply); + reply->Reply = GStrings.exists(label.GetChars() + 1)? label : FString(rsp->Reply); reply->Reply = label; } @@ -625,7 +625,7 @@ static void ParseReplies (const char *name, int pos, FStrifeDialogueReply **repl if (name) { FStringf label("$TXT_RYES%d_%s_d%d_%s", j, name, pos, TokenFromString(rsp->Yes).GetChars()); - reply->QuickYes = GStrings.exists(label)? label : FString(rsp->Yes); + reply->QuickYes = GStrings.exists(label.GetChars() + 1)? label : FString(rsp->Yes); } else { @@ -635,7 +635,7 @@ static void ParseReplies (const char *name, int pos, FStrifeDialogueReply **repl if (reply->ItemCheck[0].Item != 0) { FStringf label("$TXT_RNO%d_%s_d%d_%s", j, name, pos, TokenFromString(rsp->No).GetChars()); - reply->QuickNo = GStrings.exists(label)? label : FString(rsp->No); + reply->QuickNo = GStrings.exists(label.GetChars() + 1)? label : FString(rsp->No); } else {