Permalink
Browse files

Initialize cvarRecord_t instances correctly

  • Loading branch information...
mbasaglia committed Nov 9, 2015
1 parent d57bf9b commit 04c9435699ec76439c4ea3846b5f36abb4a2950e
Showing with 2 additions and 4 deletions.
  1. +2 −4 daemon/src/engine/framework/CvarSystem.cpp
@@ -208,8 +208,7 @@ namespace Cvar {
}

//The user creates a new cvar through a command.
cvarRecord_t cvar{value, value, flags | CVAR_USER_CREATED, "user created", nullptr, {}};
cvars[cvarName] = new cvarRecord_t(std::move(cvar));
cvars[cvarName] = new cvarRecord_t{value, value, flags | CVAR_USER_CREATED, "user created", nullptr, {}};
Cmd::AddCommand(cvarName, cvarCommand, "cvar - user created");
GetCCvar(cvarName, *cvars[cvarName]);

@@ -292,8 +291,7 @@ namespace Cvar {
}

//Create the cvar and parse its default value
cvarRecord_t temp{defaultValue, defaultValue, flags, "", proxy, {}};
cvar = new cvarRecord_t(std::move(temp));
cvar = new cvarRecord_t{defaultValue, defaultValue, flags, description, proxy, {}};
cvars[name] = cvar;

Cmd::AddCommand(name, cvarCommand, "cvar - \"" + defaultValue + "\" - " + description);

0 comments on commit 04c9435

Please sign in to comment.