From a27990885e2ff4061e0fa32e58f5701d7c3d39c2 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 22 May 2019 11:50:53 -0400 Subject: [PATCH] - add some debugging information for GZSDF pagenames feature --- src/maploader/usdf.cpp | 9 +++++++++ src/p_conversation.cpp | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/maploader/usdf.cpp b/src/maploader/usdf.cpp index d6098ab31..fa218bfb8 100644 --- a/src/maploader/usdf.cpp +++ b/src/maploader/usdf.cpp @@ -566,7 +566,10 @@ public: if (nameToIndex.CheckKey(key)) Printf("Warning! Duplicate page name '%s'!\n", Level->StrifeDialogues[i]->ThisNodeName.GetChars()); else + { nameToIndex[key] = i; + DPrintf(DMSG_NOTIFY, "GZSDF linker: Assigning pagename '%s' to node %i\n", key, i); + } usedstrings = true; } } @@ -579,7 +582,10 @@ public: { itemLinkKey.ToLower(); if (nameToIndex.CheckKey(itemLinkKey)) + { Level->StrifeDialogues[i]->ItemCheckNode = nameToIndex[itemLinkKey] + 1; + DPrintf(DMSG_NOTIFY, "GZSDF linker: Item Link '%s' in node %i was index %i\n", itemLinkKey, i, nameToIndex[itemLinkKey]); + } else Printf("Warning! Reference to non-existent item-linked dialogue page name '%s' in page %i!\n", Level->StrifeDialogues[i]->ItemCheckNodeName.GetChars(), i); } @@ -592,7 +598,10 @@ public: FString key = NodeCheck->NextNodeName; key.ToLower(); if (nameToIndex.CheckKey(key)) + { NodeCheck->NextNode = nameToIndex[key] + 1; + DPrintf(DMSG_NOTIFY, "GZSDF linker: Nextpage Link '%s' in node %i was index %i\n", key, i, nameToIndex[key]); + } else Printf("Warning! Reference to non-existent reply-linked dialogue page name '%s' in page %i!\n", NodeCheck->NextNodeName.GetChars(), i); } diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index b682f3bd5..948abff7b 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -586,6 +586,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply { int rootnode = npc->ConversationRoot; const unsigned next = (unsigned)(rootnode + reply->NextNode - 1); + FString nextname = reply->NextNodeName; if (next < Level->StrifeDialogues.Size()) { @@ -606,7 +607,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); + if (nextname.IsEmpty()) + Printf ("Next node %u is invalid, no such dialog page\n", next); + else + Printf ("Next node %u ('%s') is invalid, no such dialog page\n", next, nextname); } }