Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/engine/framework/CvarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ namespace Cvar {
cvar->description = std::move(realDescription);
}

void InternalSetValue(const std::string& cvarName, std::string value, int flags, bool rom, bool warnRom) {
void InternalSetValue(const std::string& cvarName, std::string value, bool rom, bool warnRom) {
CvarMap& cvars = GetCvarMap();

auto it = cvars.find(cvarName);
Expand All @@ -235,7 +235,7 @@ namespace Cvar {
}

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

Expand Down Expand Up @@ -263,8 +263,6 @@ namespace Cvar {
}
}

cvar->flags |= flags;

// mark for archival if flagged as archive-on-change
if (cvar->flags & ARCHIVE) {
cvar->flags |= USER_ARCHIVE;
Expand Down Expand Up @@ -302,11 +300,11 @@ namespace Cvar {

// Simple proxies for InternalSetValue
void SetValue(const std::string& cvarName, const std::string& value) {
InternalSetValue(cvarName, value, 0, false, true);
InternalSetValue(cvarName, value, false, true);
}

void SetValueForce(const std::string& cvarName, const std::string& value) {
InternalSetValue(cvarName, value, 0, true, true);
InternalSetValue(cvarName, value, true, true);
}

std::string GetValue(const std::string& cvarName) {
Expand Down Expand Up @@ -418,8 +416,8 @@ namespace Cvar {
}

cvar->flags |= flags;
cvar->ccvar.flags |= flags;

//TODO: remove it, overkill ?
//Make sure to trigger the event as if this variable was changed
cvar_modifiedFlags |= flags;
return true; // success
Expand Down Expand Up @@ -578,7 +576,7 @@ namespace Cvar {
}

void SetValueCProxy(const std::string& cvarName, const std::string& value) {
InternalSetValue(cvarName, value, 0, true, false);
InternalSetValue(cvarName, value, true, false);
}

/*
Expand Down
Loading