diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 449f9e286..90271333c 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -568,16 +568,6 @@ FStrifeDialogueNode::~FStrifeDialogueNode () } } -//============================================================================ -// -// FStrifeDialogueReply :: ~FStrifeDialogueReply -// -//============================================================================ - -FStrifeDialogueReply::~FStrifeDialogueReply () -{ -} - //============================================================================ // // FindNode diff --git a/src/p_conversation.h b/src/p_conversation.h index 302203bd2..7ee24093b 100644 --- a/src/p_conversation.h +++ b/src/p_conversation.h @@ -20,19 +20,19 @@ struct FStrifeDialogueItemCheck struct FStrifeDialogueNode { ~FStrifeDialogueNode (); - PClassActor *DropType; + PClassActor *DropType = nullptr; TArray ItemCheck; - int ThisNodeNum; // location of this node in StrifeDialogues - int ItemCheckNode; // index into StrifeDialogues + int ThisNodeNum = 0; // location of this node in StrifeDialogues + int ItemCheckNode = 0; // index into StrifeDialogues - PClassActor *SpeakerType; + PClassActor *SpeakerType = nullptr; FString SpeakerName; FSoundID SpeakerVoice; FString Backdrop; FString Dialogue; FString Goodbye; // must init to null for binary scripts to work as intended - FStrifeDialogueReply *Children; + FStrifeDialogueReply *Children = nullptr; FName MenuClassName; FString UserData; }; @@ -40,13 +40,11 @@ struct FStrifeDialogueNode // FStrifeDialogueReply holds responses the player can give to the NPC struct FStrifeDialogueReply { - ~FStrifeDialogueReply (); - - FStrifeDialogueReply *Next; - PClassActor *GiveType; - int ActionSpecial; - int Args[5]; - int PrintAmount; + FStrifeDialogueReply *Next = nullptr; + PClassActor *GiveType = nullptr; + int ActionSpecial = 0; + int Args[5] = {}; + int PrintAmount = 0; TArray ItemCheck; TArray ItemCheckRequire; TArray ItemCheckExclude; @@ -54,9 +52,9 @@ struct FStrifeDialogueReply FString QuickYes; FString QuickNo; FString LogString; - int NextNode; // index into StrifeDialogues - int LogNumber; - bool NeedsGold; + int NextNode = 0; // index into StrifeDialogues + int LogNumber = 0; + bool NeedsGold = false; }; extern TArray StrifeDialogues; diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index d2a1bb25e..5a5f3c826 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -121,7 +121,6 @@ class USDFParser : public UDMFParserBase bool ParseChoice(FStrifeDialogueReply **&replyptr) { FStrifeDialogueReply *reply = new FStrifeDialogueReply; - memset(reply, 0, sizeof(*reply)); reply->Next = *replyptr; *replyptr = reply; @@ -293,8 +292,6 @@ class USDFParser : public UDMFParserBase { FStrifeDialogueNode *node = new FStrifeDialogueNode; FStrifeDialogueReply **replyptr = &node->Children; - memset(node, 0, sizeof(*node)); - //node->ItemCheckCount[0] = node->ItemCheckCount[1] = node->ItemCheckCount[2] = -1; node->ThisNodeNum = StrifeDialogues.Push(node); node->ItemCheckNode = -1;