mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- 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:
parent
2f3ea885c5
commit
6d59fb3e9f
1 changed files with 25 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue