- Fixed: If the dialogues are freed while a dialogue menu is open, we need to close that menu,

or it will crash because the dialogue node it refers to no longer exists.

SVN r3418 (trunk)
This commit is contained in:
Randy Heit 2012-03-10 00:38:38 +00:00
parent 2f3ea885c5
commit 6d59fb3e9f

View file

@ -216,27 +216,6 @@ void P_LoadStrifeConversations (MapData *map, const char *mapname)
}
}
//============================================================================
//
// P_FreeStrifeConversations
//
//============================================================================
void P_FreeStrifeConversations ()
{
FStrifeDialogueNode *node;
while (StrifeDialogues.Pop (node))
{
delete node;
}
DialogueRoots.Clear();
ClassRoots.Clear();
PrevNode = NULL;
}
//============================================================================
//
// LoadScriptFile
@ -1065,6 +1044,31 @@ IMPLEMENT_ABSTRACT_CLASS(DConversationMenu)
int DConversationMenu::mSelection; // needs to be preserved if the same dialogue is restarted
//============================================================================
//
// P_FreeStrifeConversations
//
//============================================================================
void P_FreeStrifeConversations ()
{
FStrifeDialogueNode *node;
while (StrifeDialogues.Pop (node))
{
delete node;
}
DialogueRoots.Clear();
ClassRoots.Clear();
PrevNode = NULL;
if (DMenu::CurrentMenu != NULL && DMenu::CurrentMenu->IsKindOf(RUNTIME_CLASS(DConversationMenu)))
{
DMenu::CurrentMenu->Close();
}
}
//============================================================================
//
// P_StartConversation