Added CVar.GetCVar() function to do player-dependent console variables lookup

This commit is contained in:
alexey.lysiuk 2017-04-06 10:51:36 +03:00
parent 26e4b74261
commit ca4888eb3d
2 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -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();