From 0e449405a4c8de9c889c2cce7fb9c81e2697c577 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 cbe7f1047..c536611ae 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -352,7 +352,7 @@ static FStrifeDialogueNode *ReadRetailNode (FLevelLocals *Level, const char *nam 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 { @@ -376,7 +376,7 @@ static FStrifeDialogueNode *ReadRetailNode (FLevelLocals *Level, const char *nam 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 @@ -448,7 +448,7 @@ static FStrifeDialogueNode *ReadTeaserNode (FLevelLocals *Level, const char *nam 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 { @@ -477,7 +477,7 @@ static FStrifeDialogueNode *ReadTeaserNode (FLevelLocals *Level, const char *nam 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 { @@ -574,7 +574,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; } @@ -600,7 +600,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 { @@ -610,7 +610,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 {