diff --git a/src/common/scripting/interface/vmnatives.cpp b/src/common/scripting/interface/vmnatives.cpp index 2b57ceb25a..1b2b749aae 100644 --- a/src/common/scripting/interface/vmnatives.cpp +++ b/src/common/scripting/interface/vmnatives.cpp @@ -41,6 +41,7 @@ #include "c_cvars.h" #include "c_bind.h" #include "c_dispatch.h" +#include "m_misc.h" #include "menu.h" #include "vm.h" @@ -1032,6 +1033,11 @@ DEFINE_ACTION_FUNCTION(_CVar, FindCVar) ACTION_RETURN_POINTER(FindCVar(name.GetChars(), nullptr)); } +DEFINE_ACTION_FUNCTION(_CVar, SaveConfig) +{ + ACTION_RETURN_BOOL(M_SaveDefaults(nullptr)); +} + //============================================================================= // // diff --git a/wadsrc/static/zscript/engine/base.zs b/wadsrc/static/zscript/engine/base.zs index 18fe1b363e..69f5d66fec 100644 --- a/wadsrc/static/zscript/engine/base.zs +++ b/wadsrc/static/zscript/engine/base.zs @@ -689,6 +689,7 @@ struct CVar native }; native static CVar FindCVar(Name name); + native static bool SaveConfig(); bool GetBool() { return GetInt(); } native int GetInt(); native double GetFloat();