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

Method FixCvarCheats

client/src/main/java/jake2/client/CL.java:1364–1390  ·  view source on GitHub ↗

FixCvarCheats

()

Source from the content-addressed store, hash-verified

1362 * FixCvarCheats
1363 */
1364 private static void FixCvarCheats() {
1365 int i;
1366 CL.cheatvar_t var;
1367
1368 if ("1".equals(ClientGlobals.cl.configstrings[Defines.CS_MAXCLIENTS])
1369 || 0 == ClientGlobals.cl.configstrings[Defines.CS_MAXCLIENTS]
1370 .length())
1371 return; // single player can cheat
1372
1373 // find all the cvars if we haven't done it yet
1374 if (0 == CL.numcheatvars) {
1375 while (CL.cheatvars[CL.numcheatvars].name != null) {
1376 CL.cheatvars[CL.numcheatvars].var = Cvar.getInstance().Get(
1377 CL.cheatvars[CL.numcheatvars].name,
1378 CL.cheatvars[CL.numcheatvars].value, 0);
1379 CL.numcheatvars++;
1380 }
1381 }
1382
1383 // make sure they are all set to the proper values
1384 for (i = 0; i < CL.numcheatvars; i++) {
1385 var = CL.cheatvars[i];
1386 if (!var.var.string.equals(var.value)) {
1387 Cvar.getInstance().Set(var.name, var.value);
1388 }
1389 }
1390 }
1391
1392 // =============================================================
1393

Callers 1

SendCommandMethod · 0.95

Calls 4

getInstanceMethod · 0.95
GetMethod · 0.80
SetMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected