MCPcopy Create free account
hub / github.com/demoth/jake2 / FullSet

Method FullSet

qcommon/src/main/java/jake2/qcommon/exec/Cvar.java:170–188  ·  view source on GitHub ↗

Creates a variable if not found and sets their value, the parsed float value and their flags.

(String var_name, String value, int flags)

Source from the content-addressed store, hash-verified

168 * Creates a variable if not found and sets their value, the parsed float value and their flags.
169 */
170 public cvar_t FullSet(String var_name, String value, int flags) {
171 cvar_t var;
172
173 var = FindVar(var_name);
174 if (null == var) { // create it
175 return Get(var_name, value, flags);
176 }
177
178 var.modified = true;
179
180 if ((var.flags & CVAR_USERINFO) != 0)
181 Globals.userinfo_modified = true; // transmit at next oportunity
182
183 var.string = value;
184 var.value = Lib.atof(var.string);
185 var.flags = flags;
186
187 return var;
188 }
189
190 /**
191 * Sets the value of the variable without forcing.

Callers 6

initializeServerCvarsMethod · 0.80
spawnServerInstanceMethod · 0.80
testFullSetCreateNewMethod · 0.80
testFullSetOverwriteMethod · 0.80
InitMethod · 0.80
SetGamedirMethod · 0.80

Calls 3

FindVarMethod · 0.95
GetMethod · 0.95
atofMethod · 0.95

Tested by 2

testFullSetCreateNewMethod · 0.64
testFullSetOverwriteMethod · 0.64