FixCvarCheats
()
| 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 |
no test coverage detected