From 228c57fae3de0640bd5e1363b24a20be9224ed40 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 19:00:26 +0200 Subject: [PATCH] - fixed: Even SBARINFO needs to call the scripted Init method of the status bar because it initializes some data used by the automap HUD. --- src/g_statusbar/sbarinfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; }