Fixed crash on returning to title screen

https://mantis.zdoom.org/view.php?id=615
This commit is contained in:
alexey.lysiuk 2017-04-22 09:58:38 +03:00
parent 4e1e527b2c
commit 370b639ab1
2 changed files with 8 additions and 4 deletions

View file

@ -732,10 +732,6 @@ DIntermissionController::DIntermissionController(FIntermissionDescriptor *Desc,
mScreen = NULL;
mFirst = true;
mGameState = state;
// If the intermission finishes straight away then cancel the wipe.
if(!NextPage())
wipegamestate = GS_FINALE;
}
bool DIntermissionController::NextPage ()
@ -898,6 +894,13 @@ void F_StartIntermission(FIntermissionDescriptor *desc, bool deleteme, uint8_t s
viewactive = false;
automapactive = false;
DIntermissionController::CurrentIntermission = Create<DIntermissionController>(desc, deleteme, state);
// If the intermission finishes straight away then cancel the wipe.
if (!DIntermissionController::CurrentIntermission->NextPage())
{
wipegamestate = GS_FINALE;
}
GC::WriteBarrier(DIntermissionController::CurrentIntermission);
}

View file

@ -304,6 +304,7 @@ public:
void OnDestroy() override;
friend void F_AdvanceIntermission();
friend void F_StartIntermission(FIntermissionDescriptor *, bool, uint8_t);
};