- handle the case where SBARINFO only contains a mugshot definition and fall back to the current statusbarclass if creating an SBARINFO-based statusbar fails.

This commit is contained in:
Christoph Oelckers 2017-05-21 12:05:46 +02:00
commit be2cfddb17
2 changed files with 10 additions and 2 deletions

View file

@ -303,6 +303,15 @@ void ST_CreateStatusBar(bool bTitleLevel)
{
StatusBar = CreateCustomStatusBar(SCRIPT_DEFAULT);
}
// SBARINFO failed so try the current statusbarclass again.
if (StatusBar == nullptr)
{
auto cls = PClass::FindClass(gameinfo.statusbarclass);
if (cls != nullptr)
{
StatusBar = (DBaseStatusBar *)cls->CreateNew();
}
}
}
if (StatusBar == nullptr)
{