Marked internal menu commands as safe
This fixes soundfont/patchset/config selection menus in advanced sound options
This commit is contained in:
parent
c8b6e5719e
commit
d9323b9740
3 changed files with 9 additions and 3 deletions
|
|
@ -58,6 +58,7 @@
|
|||
#include "vm.h"
|
||||
#include "events.h"
|
||||
#include "gl/renderer/gl_renderer.h" // for menu blur
|
||||
#include "scripting/types.h"
|
||||
|
||||
//
|
||||
// Todo: Move these elsewhere
|
||||
|
|
@ -1180,6 +1181,8 @@ DMenuItemBase * CreateOptionMenuItemCommand(const char *label, FName cmd, bool c
|
|||
VMValue params[] = { p, &namestr, cmd.GetIndex(), centered };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
auto unsafe = dyn_cast<PField>(c->FindSymbol("mUnsafe", false));
|
||||
unsafe->Type->SetValue(reinterpret_cast<uint8_t*>(p) + unsafe->Offset, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue