Skip to content

Commit

Permalink
- add some debugging information for GZSDF pagenames feature
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed May 22, 2019
1 parent a04d79d commit a279908
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/maploader/usdf.cpp
Expand Up @@ -566,7 +566,10 @@ class USDFParser : public UDMFParserBase
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;
}
}
Expand All @@ -579,7 +582,10 @@ class USDFParser : public UDMFParserBase
{
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);
}
Expand All @@ -592,7 +598,10 @@ class USDFParser : public UDMFParserBase
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);
}
Expand Down
6 changes: 5 additions & 1 deletion src/p_conversation.cpp
Expand Up @@ -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())
{
Expand All @@ -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);
}
}

Expand Down

2 comments on commit a279908

@drfrag666
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed some Travis CI checks:
drfrag666@988c2ca

@madame-rachelle
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot they were so picky.

Thanks.

Please sign in to comment.