diff --git a/src/g_statusbar/sbarinfo.cpp b/src/g_statusbar/sbarinfo.cpp index 2c9d962c4e..a5fd45d288 100644 --- a/src/g_statusbar/sbarinfo.cpp +++ b/src/g_statusbar/sbarinfo.cpp @@ -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("core") = core; sbar->SetSize(script->height, script->_resW, script->_resH); sbar->CompleteBorder = script->completeBorder; + return sbar; }