diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 5b33cc263..f223444e4 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -1544,6 +1544,14 @@ DEFINE_ACTION_FUNCTION(_CVar, FindCVar) ACTION_RETURN_POINTER(FindCVar(name, nullptr)); } +DEFINE_ACTION_FUNCTION(_CVar, GetCVar) +{ + PARAM_PROLOGUE; + PARAM_NAME(name); + PARAM_POINTER_DEF(plyr, player_t); + ACTION_RETURN_POINTER(GetCVar(plyr ? plyr->mo : nullptr, name)); +} + FBaseCVar *FindCVarSub (const char *var_name, int namelen) { FBaseCVar *var; diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index c62620b14..0f1195cbf 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -287,6 +287,7 @@ struct CVar native }; native static CVar FindCVar(Name name); + native static CVar GetCVar(Name name, PlayerInfo player = null); native int GetInt(); native double GetFloat(); native String GetString();