- fixed: Even SBARINFO needs to call the scripted Init method of the status bar because it initializes some data used by the automap HUD.

This commit is contained in:
Christoph Oelckers 2017-03-30 19:00:26 +02:00
parent 91ac6e30fe
commit 228c57fae3
1 changed files with 7 additions and 0 deletions

View File

@ -57,6 +57,7 @@
#include "gstrings.h"
#include "cmdlib.h"
#include "g_levellocals.h"
#include "virtual.h"
#define ARTIFLASH_OFFSET (statusBar->invBarOffset+6)
enum
@ -1545,10 +1546,16 @@ DBaseStatusBar *CreateCustomStatusBar(int scriptno)
I_FatalError("Tried to create a status bar with no script!");
auto sbar = (DBaseStatusBar*)PClass::FindClass("SBarInfoWrapper")->CreateNew();
IFVIRTUALPTR(sbar, DBaseStatusBar, Init)
{
VMValue params[] = { sbar };
GlobalVMStack.Call(func, params, 1, nullptr, 0);
}
auto core = new DSBarInfo(sbar, script);
sbar->PointerVar<DSBarInfo>("core") = core;
sbar->SetSize(script->height, script->_resW, script->_resH);
sbar->CompleteBorder = script->completeBorder;
return sbar;
}