MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / setVariable

Function setVariable

TheForceEngine/TFE_FrontEndUI/console.cpp:724–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722 }
723
724 void setVariable(const char* name, const char* value)
725 {
726 char errorMsg[CSTR_LEN];
727
728 size_t count = s_var.size();
729 for (size_t i = 0; i < count; i++)
730 {
731 if (s_var[i].name == name)
732 {
733 if (s_var[i].flags & CVFLAG_READ_ONLY)
734 {
735 sprintf(errorMsg, "Cannot change Read-Only variable \"%s\"", name);
736 s_history.push_back({ c_historyErrorColor, errorMsg });
737 return;
738 }
739 setVariableValue(&s_var[i], value);
740 return;
741 }
742 }
743
744 sprintf(errorMsg, "set - Unknown variable \"%s\"", name);
745 s_history.push_back({ c_historyErrorColor, errorMsg });
746 }
747
748 void getVariable(const char* name, char* value)
749 {

Callers 1

c_setFunction · 0.85

Calls 3

setVariableValueFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected