Skip to content

Commit 94593e4

Browse files
committed
Cleanup: InternalSetValue flags argument always 0
Remove the pointless `int flags` argument to Cvar::InternalSetValue which is always 0.
1 parent 9a1187d commit 94593e4

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/engine/framework/CvarSystem.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace Cvar {
223223
cvar->description = std::move(realDescription);
224224
}
225225

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

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

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

@@ -263,8 +263,6 @@ namespace Cvar {
263263
}
264264
}
265265

266-
cvar->flags |= flags;
267-
268266
// mark for archival if flagged as archive-on-change
269267
if (cvar->flags & ARCHIVE) {
270268
cvar->flags |= USER_ARCHIVE;
@@ -302,11 +300,11 @@ namespace Cvar {
302300

303301
// Simple proxies for InternalSetValue
304302
void SetValue(const std::string& cvarName, const std::string& value) {
305-
InternalSetValue(cvarName, value, 0, false, true);
303+
InternalSetValue(cvarName, value, false, true);
306304
}
307305

308306
void SetValueForce(const std::string& cvarName, const std::string& value) {
309-
InternalSetValue(cvarName, value, 0, true, true);
307+
InternalSetValue(cvarName, value, true, true);
310308
}
311309

312310
std::string GetValue(const std::string& cvarName) {
@@ -578,7 +576,7 @@ namespace Cvar {
578576
}
579577

580578
void SetValueCProxy(const std::string& cvarName, const std::string& value) {
581-
InternalSetValue(cvarName, value, 0, true, false);
579+
InternalSetValue(cvarName, value, true, false);
582580
}
583581

584582
/*

0 commit comments

Comments
 (0)