Esempio n. 1
0
    public static void Cvar_Set(string name, string value)
    {
        cvar_t var = Cvar_FindVar(name);

        if (var == null)
        {
            // there is an error in C code if this happens
            game_engine.Con_Printf("Cvar.Set: variable {0} not found\n", name);
            return;
        }
        var.Set(value);
    }
Esempio n. 2
0
    public static bool Cvar_Command()
    {
        // check variables
        cvar_t var = Cvar_FindVar(game_engine.Cmd_Argv(0));

        if (var == null)
        {
            return(false);
        }

        // perform a variable print or set
        if (game_engine.cmd_argc == 1)
        {
            game_engine.Con_Printf("\"{0}\" is \"{1}\"\n", var.name, var.@string);
        }
        else
        {
            var.Set(game_engine.Cmd_Argv(1));
        }
        return(true);
    }