View Issue Details

IDProjectCategoryView StatusLast Update
0000300Gameplay + OpenGL[All Projects] Bugpublic2017-02-19 09:09
Reporter_mental_ 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000300: Broken save/load menu
DescriptionAfter scriptification of menus <New Save Game> entry is added to save and load menus as many time as game is saved.
It's possible to crash the game by manipulating with these extra entries.
Steps To Reproduce1. Start new game
2. Save
3. Open load menu and notice <New Save Game> entry there
4. Open save menu and notice extra <New Save Game> entry there
Additional InformationThe problem lies in changes of TextEnterMenu and SaveMenu cooperation.
Order of calls was swapped here in comparison with native menus.
Now SaveMenu instance can use text stored in TextEnterMenu object however Destroy was never called for the first object because of that.

I think that M_ClearMenus() function can be rewritten like this to fix the problem above:
void M_ClearMenus ()
{
    M_DemoNoPlay = false;
    while (CurrentMenu != nullptr)
    {
        DMenu* parent = CurrentMenu->mParentMenu;
        CurrentMenu->Destroy();
        CurrentMenu = parent;
    }
    V_SetBorderNeedRefresh();
    menuactive = MENU_Off;
}

Although this function called from many places and I cannot say that it's 100% safe to do so.
TagsNo tags attached.

Relationships

Activities

Graf Zahl

Graf Zahl

2017-02-19 09:08

administrator   ~0000655

The fix looks ok, this should be done anyway, it was just lucky happenstance that with the internal menus it never caused issues.

Issue History

Date Modified Username Field Change
2017-02-19 08:02 _mental_ New Issue
2017-02-19 09:08 Graf Zahl Note Added: 0000655
2017-02-19 09:09 Graf Zahl Status new => resolved
2017-02-19 09:09 Graf Zahl Resolution open => fixed