MCPcopy Create free account
hub / github.com/JACoders/OpenJK / ClientCommand

Function ClientCommand

code/game/g_cmds.cpp:1368–1619  ·  view source on GitHub ↗

================= ClientCommand ================= */

Source from the content-addressed store, hash-verified

1366=================
1367*/
1368void ClientCommand( int clientNum ) {
1369 gentity_t *ent;
1370 const char *cmd;
1371
1372 ent = g_entities + clientNum;
1373 if ( !ent->client ) {
1374 return; // not fully in game yet
1375 }
1376
1377 cmd = gi.argv(0);
1378
1379 if (Q_stricmp (cmd, "spawn") == 0)
1380 {
1381 Cmd_Spawn( ent );
1382 return;
1383 }
1384
1385 if (Q_stricmp (cmd, "give") == 0)
1386 Cmd_Give_f (ent);
1387 else if (Q_stricmp (cmd, "god") == 0)
1388 Cmd_God_f (ent);
1389 else if (Q_stricmp (cmd, "undying") == 0)
1390 Cmd_Undying_f (ent);
1391 else if (Q_stricmp (cmd, "notarget") == 0)
1392 Cmd_Notarget_f (ent);
1393 else if (Q_stricmp (cmd, "noclip") == 0)
1394 {
1395 Cmd_Noclip_f (ent);
1396 }
1397 else if (Q_stricmp (cmd, "kill") == 0)
1398 {
1399 if ( !CheatsOk( ent ) )
1400 {
1401 return;
1402 }
1403 Cmd_Kill_f (ent);
1404 }
1405 else if (Q_stricmp (cmd, "levelshot") == 0)
1406 Cmd_LevelShot_f (ent);
1407 else if (Q_stricmp (cmd, "where") == 0)
1408 Cmd_Where_f (ent);
1409 else if (Q_stricmp (cmd, "setviewpos") == 0)
1410 Cmd_SetViewpos_f( ent );
1411 else if (Q_stricmp (cmd, "setobjective") == 0)
1412 Cmd_SetObjective_f( ent );
1413 else if (Q_stricmp (cmd, "viewobjective") == 0)
1414 Cmd_ViewObjective_f( ent );
1415 else if (Q_stricmp (cmd, "force_throw") == 0)
1416 {
1417 ent = G_GetSelfForPlayerCmd();
1418 ForceThrow( ent, qfalse );
1419 }
1420 else if (Q_stricmp (cmd, "force_pull") == 0)
1421 {
1422 ent = G_GetSelfForPlayerCmd();
1423 ForceThrow( ent, qtrue );
1424 }
1425 else if (Q_stricmp (cmd, "force_speed") == 0)

Callers

nothing calls this directly

Calls 15

Q_stricmpFunction · 0.85
Cmd_FlushCamFile_fFunction · 0.85
Cmd_SaberDrop_fFunction · 0.85
Cmd_SpawnFunction · 0.70
Cmd_Give_fFunction · 0.70
Cmd_God_fFunction · 0.70
Cmd_Undying_fFunction · 0.70
Cmd_Notarget_fFunction · 0.70
Cmd_Noclip_fFunction · 0.70
CheatsOkFunction · 0.70
Cmd_Kill_fFunction · 0.70
Cmd_LevelShot_fFunction · 0.70

Tested by

no test coverage detected