icculus quake2 doxygen  1.0 dev
g_main.c File Reference
#include "g_local.h"

Go to the source code of this file.

Functions

void SpawnEntities (char *mapname, char *entities, char *spawnpoint)
 
void ClientThink (edict_t *ent, usercmd_t *cmd)
 
qboolean ClientConnect (edict_t *ent, char *userinfo)
 
void ClientUserinfoChanged (edict_t *ent, char *userinfo)
 
void ClientDisconnect (edict_t *ent)
 
void ClientBegin (edict_t *ent)
 
void ClientCommand (edict_t *ent)
 
void RunEntity (edict_t *ent)
 
void WriteGame (char *filename, qboolean autosave)
 
void ReadGame (char *filename)
 
void WriteLevel (char *filename)
 
void ReadLevel (char *filename)
 
void InitGame (void)
 
void G_RunFrame (void)
 
void ShutdownGame (void)
 
game_export_tGetGameAPI (game_import_t *import)
 
void Sys_Error (char *error,...)
 
void Com_Printf (char *msg,...)
 
void ClientEndServerFrames (void)
 
edict_tCreateTargetChangeLevel (char *map)
 
void EndDMLevel (void)
 
void CheckNeedPass (void)
 
void CheckDMRules (void)
 
void ExitLevel (void)
 

Variables

game_locals_t game
 
level_locals_t level
 
game_import_t gi
 
game_export_t globals
 
spawn_temp_t st
 
int sm_meat_index
 
int snd_fry
 
int meansOfDeath
 
edict_tg_edicts
 
cvar_tdeathmatch
 
cvar_tcoop
 
cvar_tdmflags
 
cvar_tskill
 
cvar_tfraglimit
 
cvar_ttimelimit
 
cvar_tpassword
 
cvar_tspectator_password
 
cvar_tneedpass
 
cvar_tmaxclients
 
cvar_tmaxspectators
 
cvar_tmaxentities
 
cvar_tg_select_empty
 
cvar_tdedicated
 
cvar_tfilterban
 
cvar_tsv_maxvelocity
 
cvar_tsv_gravity
 
cvar_tsv_rollspeed
 
cvar_tsv_rollangle
 
cvar_tgun_x
 
cvar_tgun_y
 
cvar_tgun_z
 
cvar_trun_pitch
 
cvar_trun_roll
 
cvar_tbob_up
 
cvar_tbob_pitch
 
cvar_tbob_roll
 
cvar_tsv_cheats
 
cvar_tflood_msgs
 
cvar_tflood_persecond
 
cvar_tflood_waitdelay
 
cvar_tsv_maplist
 
cvar_tgib_on
 

Function Documentation

◆ CheckDMRules()

void CheckDMRules ( void  )

Definition at line 306 of file g_main.c.

307 {
308  int i;
309  gclient_t *cl;
310 
312  return;
313 
314  if (!deathmatch->value)
315  return;
316 
317  if (timelimit->value)
318  {
319  if (level.time >= timelimit->value*60)
320  {
321  gi.bprintf (PRINT_HIGH, "Timelimit hit.\n");
322  EndDMLevel ();
323  return;
324  }
325  }
326 
327  if (fraglimit->value)
328  {
329  for (i=0 ; i<maxclients->value ; i++)
330  {
331  cl = game.clients + i;
332  if (!g_edicts[i+1].inuse)
333  continue;
334 
335  if (cl->resp.score >= fraglimit->value)
336  {
337  gi.bprintf (PRINT_HIGH, "Fraglimit hit.\n");
338  EndDMLevel ();
339  return;
340  }
341  }
342  }
343 }

Referenced by G_RunFrame().

◆ CheckNeedPass()

void CheckNeedPass ( void  )

Definition at line 280 of file g_main.c.

281 {
282  int need;
283 
284  // if password or spectator_password has changed, update needpass
285  // as needed
287  {
289 
290  need = 0;
291 
292  if (*password->string && Q_stricmp(password->string, "none"))
293  need |= 1;
295  need |= 2;
296 
297  gi.cvar_set("needpass", va("%d", need));
298  }
299 }

Referenced by G_RunFrame().

◆ ClientBegin()

void ClientBegin ( edict_t ent)

Definition at line 1305 of file p_client.c.

1306 {
1307  int i;
1308 
1309  ent->client = game.clients + (ent - g_edicts - 1);
1310 
1311  if (deathmatch->value)
1312  {
1313  ClientBeginDeathmatch (ent);
1314  return;
1315  }
1316 
1317  // if there is already a body waiting for us (a loadgame), just
1318  // take it, otherwise spawn one from scratch
1319  if (ent->inuse == true)
1320  {
1321  // the client has cleared the client side viewangles upon
1322  // connecting to the server, which is different than the
1323  // state when the game is saved, so we need to compensate
1324  // with deltaangles
1325  for (i=0 ; i<3 ; i++)
1327  }
1328  else
1329  {
1330  // a spawn point will completely reinitialize the entity
1331  // except for the persistant data that was initialized at
1332  // ClientConnect() time
1333  G_InitEdict (ent);
1334  ent->classname = "player";
1335  InitClientResp (ent->client);
1336  PutClientInServer (ent);
1337  }
1338 
1339  if (level.intermissiontime)
1340  {
1342  }
1343  else
1344  {
1345  // send effect if in a multiplayer game
1346  if (game.maxclients > 1)
1347  {
1349  gi.WriteShort (ent-g_edicts);
1350  gi.WriteByte (MZ_LOGIN);
1351  gi.multicast (ent->s.origin, MULTICAST_PVS);
1352 
1353  gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname);
1354  }
1355  }
1356 
1357  // make sure all view stuff is valid
1358  ClientEndServerFrame (ent);
1359 }

Referenced by GetGameAPI().

◆ ClientCommand()

void ClientCommand ( edict_t ent)

Definition at line 909 of file g_cmds.c.

910 {
911  char *cmd;
912 
913  if (!ent->client)
914  return; // not fully in game yet
915 
916  cmd = gi.argv(0);
917 
918  if (Q_stricmp (cmd, "players") == 0)
919  {
920  Cmd_Players_f (ent);
921  return;
922  }
923  if (Q_stricmp (cmd, "say") == 0)
924  {
925  Cmd_Say_f (ent, false, false);
926  return;
927  }
928  if (Q_stricmp (cmd, "say_team") == 0)
929  {
930  Cmd_Say_f (ent, true, false);
931  return;
932  }
933  if (Q_stricmp (cmd, "score") == 0)
934  {
935  Cmd_Score_f (ent);
936  return;
937  }
938  if (Q_stricmp (cmd, "help") == 0)
939  {
940  Cmd_Help_f (ent);
941  return;
942  }
943 
944  if (level.intermissiontime)
945  return;
946 
947  if (Q_stricmp (cmd, "use") == 0)
948  Cmd_Use_f (ent);
949  else if (Q_stricmp (cmd, "drop") == 0)
950  Cmd_Drop_f (ent);
951  else if (Q_stricmp (cmd, "give") == 0)
952  Cmd_Give_f (ent);
953  else if (Q_stricmp (cmd, "god") == 0)
954  Cmd_God_f (ent);
955  else if (Q_stricmp (cmd, "notarget") == 0)
956  Cmd_Notarget_f (ent);
957  else if (Q_stricmp (cmd, "noclip") == 0)
958  Cmd_Noclip_f (ent);
959  else if (Q_stricmp (cmd, "inven") == 0)
960  Cmd_Inven_f (ent);
961  else if (Q_stricmp (cmd, "invnext") == 0)
962  SelectNextItem (ent, -1);
963  else if (Q_stricmp (cmd, "invprev") == 0)
964  SelectPrevItem (ent, -1);
965  else if (Q_stricmp (cmd, "invnextw") == 0)
966  SelectNextItem (ent, IT_WEAPON);
967  else if (Q_stricmp (cmd, "invprevw") == 0)
968  SelectPrevItem (ent, IT_WEAPON);
969  else if (Q_stricmp (cmd, "invnextp") == 0)
970  SelectNextItem (ent, IT_POWERUP);
971  else if (Q_stricmp (cmd, "invprevp") == 0)
972  SelectPrevItem (ent, IT_POWERUP);
973  else if (Q_stricmp (cmd, "invuse") == 0)
974  Cmd_InvUse_f (ent);
975  else if (Q_stricmp (cmd, "invdrop") == 0)
976  Cmd_InvDrop_f (ent);
977  else if (Q_stricmp (cmd, "weapprev") == 0)
978  Cmd_WeapPrev_f (ent);
979  else if (Q_stricmp (cmd, "weapnext") == 0)
980  Cmd_WeapNext_f (ent);
981  else if (Q_stricmp (cmd, "weaplast") == 0)
982  Cmd_WeapLast_f (ent);
983  else if (Q_stricmp (cmd, "kill") == 0)
984  Cmd_Kill_f (ent);
985  else if (Q_stricmp (cmd, "putaway") == 0)
986  Cmd_PutAway_f (ent);
987  else if (Q_stricmp (cmd, "wave") == 0)
988  Cmd_Wave_f (ent);
989  else if (Q_stricmp(cmd, "playerlist") == 0)
990  Cmd_PlayerList_f(ent);
991  else // anything that doesn't match a command will be a chat
992  Cmd_Say_f (ent, false, true);
993 }

Referenced by GetGameAPI().

◆ ClientConnect()

qboolean ClientConnect ( edict_t ent,
char *  userinfo 
)

Definition at line 1440 of file p_client.c.

1441 {
1442  char *value;
1443 
1444  // check to see if they are on the banned IP list
1445  value = Info_ValueForKey (userinfo, "ip");
1446  if (SV_FilterPacket(value)) {
1447  Info_SetValueForKey(userinfo, "rejmsg", "Banned.");
1448  return false;
1449  }
1450 
1451  // check for a spectator
1452  value = Info_ValueForKey (userinfo, "spectator");
1453  if (deathmatch->value && *value && strcmp(value, "0")) {
1454  int i, numspec;
1455 
1456  if (*spectator_password->string &&
1457  strcmp(spectator_password->string, "none") &&
1458  strcmp(spectator_password->string, value)) {
1459  Info_SetValueForKey(userinfo, "rejmsg", "Spectator password required or incorrect.");
1460  return false;
1461  }
1462 
1463  // count spectators
1464  for (i = numspec = 0; i < maxclients->value; i++)
1465  if (g_edicts[i+1].inuse && g_edicts[i+1].client->pers.spectator)
1466  numspec++;
1467 
1468  if (numspec >= maxspectators->value) {
1469  Info_SetValueForKey(userinfo, "rejmsg", "Server spectator limit is full.");
1470  return false;
1471  }
1472  } else {
1473  // check for a password
1474  value = Info_ValueForKey (userinfo, "password");
1475  if (*password->string && strcmp(password->string, "none") &&
1476  strcmp(password->string, value)) {
1477  Info_SetValueForKey(userinfo, "rejmsg", "Password required or incorrect.");
1478  return false;
1479  }
1480  }
1481 
1482 
1483  // they can connect
1484  ent->client = game.clients + (ent - g_edicts - 1);
1485 
1486  // if there is already a body waiting for us (a loadgame), just
1487  // take it, otherwise spawn one from scratch
1488  if (ent->inuse == false)
1489  {
1490  // clear the respawning variables
1491  InitClientResp (ent->client);
1492  if (!game.autosaved || !ent->client->pers.weapon)
1494  }
1495 
1496  ClientUserinfoChanged (ent, userinfo);
1497 
1498  if (game.maxclients > 1)
1499  gi.dprintf ("%s connected\n", ent->client->pers.netname);
1500 
1501  ent->svflags = 0; // make sure we start with known default
1502  ent->client->pers.connected = true;
1503  return true;
1504 }

Referenced by GetGameAPI().

◆ ClientDisconnect()

void ClientDisconnect ( edict_t ent)

Definition at line 1514 of file p_client.c.

1515 {
1516  int playernum;
1517 
1518  if (!ent->client)
1519  return;
1520 
1521  gi.bprintf (PRINT_HIGH, "%s disconnected\n", ent->client->pers.netname);
1522 
1523  // send effect
1525  gi.WriteShort (ent-g_edicts);
1527  gi.multicast (ent->s.origin, MULTICAST_PVS);
1528 
1529  gi.unlinkentity (ent);
1530  ent->s.modelindex = 0;
1531  ent->solid = SOLID_NOT;
1532  ent->inuse = false;
1533  ent->classname = "disconnected";
1534  ent->client->pers.connected = false;
1535 
1536  playernum = ent-g_edicts-1;
1537  gi.configstring (CS_PLAYERSKINS+playernum, "");
1538 }

Referenced by GetGameAPI().

◆ ClientEndServerFrames()

void ClientEndServerFrames ( void  )

Definition at line 179 of file g_main.c.

180 {
181  int i;
182  edict_t *ent;
183 
184  // calc the player views now that all pushing
185  // and damage has been added
186  for (i=0 ; i<maxclients->value ; i++)
187  {
188  ent = g_edicts + 1 + i;
189  if (!ent->inuse || !ent->client)
190  continue;
191  ClientEndServerFrame (ent);
192  }
193 
194 }

Referenced by ExitLevel(), and G_RunFrame().

◆ ClientThink()

void ClientThink ( edict_t ent,
usercmd_t cmd 
)

Definition at line 1580 of file p_client.c.

1581 {
1582  gclient_t *client;
1583  edict_t *other;
1584  int i, j;
1585  pmove_t pm;
1586 
1587  level.current_entity = ent;
1588  client = ent->client;
1589 
1590  if (level.intermissiontime)
1591  {
1592  client->ps.pmove.pm_type = PM_FREEZE;
1593  // can exit intermission after five seconds
1594  if (level.time > level.intermissiontime + 5.0
1595  && (ucmd->buttons & BUTTON_ANY) )
1596  level.exitintermission = true;
1597  return;
1598  }
1599 
1600  pm_passent = ent;
1601 
1602  if (ent->client->chase_target) {
1603 
1604  client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
1605  client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
1606  client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);
1607 
1608  } else {
1609 
1610  // set up for pmove
1611  memset (&pm, 0, sizeof(pm));
1612 
1613  if (ent->movetype == MOVETYPE_NOCLIP)
1614  client->ps.pmove.pm_type = PM_SPECTATOR;
1615  else if (ent->s.modelindex != 255)
1616  client->ps.pmove.pm_type = PM_GIB;
1617  else if (ent->deadflag)
1618  client->ps.pmove.pm_type = PM_DEAD;
1619  else
1620  client->ps.pmove.pm_type = PM_NORMAL;
1621 
1622  client->ps.pmove.gravity = sv_gravity->value;
1623  pm.s = client->ps.pmove;
1624 
1625  for (i=0 ; i<3 ; i++)
1626  {
1627  pm.s.origin[i] = ent->s.origin[i]*8;
1628  pm.s.velocity[i] = ent->velocity[i]*8;
1629  }
1630 
1631  if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s)))
1632  {
1633  pm.snapinitial = true;
1634  // gi.dprintf ("pmove changed!\n");
1635  }
1636 
1637  pm.cmd = *ucmd;
1638 
1639  pm.trace = PM_trace; // adds default parms
1641 
1642  // perform a pmove
1643  gi.Pmove (&pm);
1644 
1645  // save results of pmove
1646  client->ps.pmove = pm.s;
1647  client->old_pmove = pm.s;
1648 
1649  for (i=0 ; i<3 ; i++)
1650  {
1651  ent->s.origin[i] = pm.s.origin[i]*0.125;
1652  ent->velocity[i] = pm.s.velocity[i]*0.125;
1653  }
1654 
1655  VectorCopy (pm.mins, ent->mins);
1656  VectorCopy (pm.maxs, ent->maxs);
1657 
1658  client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
1659  client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
1660  client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);
1661 
1662  if (ent->groundentity && !pm.groundentity && (pm.cmd.upmove >= 10) && (pm.waterlevel == 0))
1663  {
1664  gi.sound(ent, CHAN_VOICE, gi.soundindex("*jump1.wav"), 1, ATTN_NORM, 0);
1665  PlayerNoise(ent, ent->s.origin, PNOISE_SELF);
1666  }
1667 
1668  ent->viewheight = pm.viewheight;
1669  ent->waterlevel = pm.waterlevel;
1670  ent->watertype = pm.watertype;
1671  ent->groundentity = pm.groundentity;
1672  if (pm.groundentity)
1674 
1675  if (ent->deadflag)
1676  {
1677  client->ps.viewangles[ROLL] = 40;
1678  client->ps.viewangles[PITCH] = -15;
1679  client->ps.viewangles[YAW] = client->killer_yaw;
1680  }
1681  else
1682  {
1683  VectorCopy (pm.viewangles, client->v_angle);
1684  VectorCopy (pm.viewangles, client->ps.viewangles);
1685  }
1686 
1687  gi.linkentity (ent);
1688 
1689  if (ent->movetype != MOVETYPE_NOCLIP)
1690  G_TouchTriggers (ent);
1691 
1692  // touch other objects
1693  for (i=0 ; i<pm.numtouch ; i++)
1694  {
1695  other = pm.touchents[i];
1696  for (j=0 ; j<i ; j++)
1697  if (pm.touchents[j] == other)
1698  break;
1699  if (j != i)
1700  continue; // duplicated
1701  if (!other->touch)
1702  continue;
1703  other->touch (other, ent, NULL, NULL);
1704  }
1705 
1706  }
1707 
1708  client->oldbuttons = client->buttons;
1709  client->buttons = ucmd->buttons;
1710  client->latched_buttons |= client->buttons & ~client->oldbuttons;
1711 
1712  // save light level the player is standing on for
1713  // monster sighting AI
1714  ent->light_level = ucmd->lightlevel;
1715 
1716  // fire weapon from final position if needed
1717  if (client->latched_buttons & BUTTON_ATTACK)
1718  {
1719  if (client->resp.spectator) {
1720 
1721  client->latched_buttons = 0;
1722 
1723  if (client->chase_target) {
1724  client->chase_target = NULL;
1725  client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
1726  } else
1727  GetChaseTarget(ent);
1728 
1729  } else if (!client->weapon_thunk) {
1730  client->weapon_thunk = true;
1731  Think_Weapon (ent);
1732  }
1733  }
1734 
1735  if (client->resp.spectator) {
1736  if (ucmd->upmove >= 10) {
1737  if (!(client->ps.pmove.pm_flags & PMF_JUMP_HELD)) {
1738  client->ps.pmove.pm_flags |= PMF_JUMP_HELD;
1739  if (client->chase_target)
1740  ChaseNext(ent);
1741  else
1742  GetChaseTarget(ent);
1743  }
1744  } else
1745  client->ps.pmove.pm_flags &= ~PMF_JUMP_HELD;
1746  }
1747 
1748  // update chase cam if being followed
1749  for (i = 1; i <= maxclients->value; i++) {
1750  other = g_edicts + i;
1751  if (other->inuse && other->client->chase_target == ent)
1752  UpdateChaseCam(other);
1753  }
1754 }

Referenced by GetGameAPI().

◆ ClientUserinfoChanged()

void ClientUserinfoChanged ( edict_t ent,
char *  userinfo 
)

Definition at line 1371 of file p_client.c.

1372 {
1373  char *s;
1374  int playernum;
1375 
1376  // check for malformed or illegal info strings
1377  if (!Info_Validate(userinfo))
1378  {
1379  strcpy (userinfo, "\\name\\badinfo\\skin\\male/grunt");
1380  }
1381 
1382  // set name
1383  s = Info_ValueForKey (userinfo, "name");
1384  strncpy (ent->client->pers.netname, s, sizeof(ent->client->pers.netname)-1);
1385 
1386  // set spectator
1387  s = Info_ValueForKey (userinfo, "spectator");
1388  // spectators are only supported in deathmatch
1389  if (deathmatch->value && *s && strcmp(s, "0"))
1390  ent->client->pers.spectator = true;
1391  else
1392  ent->client->pers.spectator = false;
1393 
1394  // set skin
1395  s = Info_ValueForKey (userinfo, "skin");
1396 
1397  playernum = ent-g_edicts-1;
1398 
1399  // combine name and skin into a configstring
1400  gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, s) );
1401 
1402  // fov
1403  if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV))
1404  {
1405  ent->client->ps.fov = 90;
1406  }
1407  else
1408  {
1409  ent->client->ps.fov = atoi(Info_ValueForKey(userinfo, "fov"));
1410  if (ent->client->ps.fov < 1)
1411  ent->client->ps.fov = 90;
1412  else if (ent->client->ps.fov > 160)
1413  ent->client->ps.fov = 160;
1414  }
1415 
1416  // handedness
1417  s = Info_ValueForKey (userinfo, "hand");
1418  if (strlen(s))
1419  {
1420  ent->client->pers.hand = atoi(s);
1421  }
1422 
1423  // save off the userinfo in case we want to check something later
1424  strncpy (ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)-1);
1425 }

Referenced by ClientConnect(), GetGameAPI(), and PutClientInServer().

◆ Com_Printf()

void Com_Printf ( char *  msg,
  ... 
)

Definition at line 157 of file g_main.c.

158 {
159  va_list argptr;
160  char text[1024];
161 
162  va_start (argptr, msg);
163  vsprintf (text, msg, argptr);
164  va_end (argptr);
165 
166  gi.dprintf ("%s", text);
167 }

◆ CreateTargetChangeLevel()

edict_t* CreateTargetChangeLevel ( char *  map)

Definition at line 203 of file g_main.c.

204 {
205  edict_t *ent;
206 
207  ent = G_Spawn ();
208  ent->classname = "target_changelevel";
209  Com_sprintf(level.nextmap, sizeof(level.nextmap), "%s", map);
210  ent->map = level.nextmap;
211  return ent;
212 }

Referenced by EndDMLevel().

◆ EndDMLevel()

void EndDMLevel ( void  )

Definition at line 221 of file g_main.c.

222 {
223  edict_t *ent;
224  char *s, *t, *f;
225  static const char *seps = " ,\n\r";
226 
227  // stay on same level flag
228  if ((int)dmflags->value & DF_SAME_LEVEL)
229  {
231  return;
232  }
233 
234  // see if it's in the map list
235  if (*sv_maplist->string) {
236  s = strdup(sv_maplist->string);
237  f = NULL;
238  t = strtok(s, seps);
239  while (t != NULL) {
240  if (Q_stricmp(t, level.mapname) == 0) {
241  // it's in the list, go to the next one
242  t = strtok(NULL, seps);
243  if (t == NULL) { // end of list, go to first one
244  if (f == NULL) // there isn't a first one, same level
246  else
248  } else
250  free(s);
251  return;
252  }
253  if (!f)
254  f = t;
255  t = strtok(NULL, seps);
256  }
257  free(s);
258  }
259 
260  if (level.nextmap[0]) // go to a specific map
262  else { // search for a changelevel
263  ent = G_Find (NULL, FOFS(classname), "target_changelevel");
264  if (!ent)
265  { // the map designer didn't include a changelevel,
266  // so create a fake ent that goes back to the same level
268  return;
269  }
270  BeginIntermission (ent);
271  }
272 }

Referenced by CheckDMRules().

◆ ExitLevel()

void ExitLevel ( void  )

Definition at line 351 of file g_main.c.

352 {
353  int i;
354  edict_t *ent;
355  char command [256];
356 
357  Com_sprintf (command, sizeof(command), "gamemap \"%s\"\n", level.changemap);
358  gi.AddCommandString (command);
359  level.changemap = NULL;
363 
364  // clear some things before going to next level
365  for (i=0 ; i<maxclients->value ; i++)
366  {
367  ent = g_edicts + 1 + i;
368  if (!ent->inuse)
369  continue;
370  if (ent->health > ent->client->pers.max_health)
371  ent->health = ent->client->pers.max_health;
372  }
373 
374 }

Referenced by G_RunFrame().

◆ G_RunFrame()

void G_RunFrame ( void  )

Definition at line 383 of file g_main.c.

384 {
385  int i;
386  edict_t *ent;
387 
388  level.framenum++;
390 
391  // choose a client for monsters to target this frame
393 
394  // exit intermissions
395 
397  {
398  ExitLevel ();
399  return;
400  }
401 
402  //
403  // treat each object in turn
404  // even the world gets a chance to think
405  //
406  ent = &g_edicts[0];
407  for (i=0 ; i<globals.num_edicts ; i++, ent++)
408  {
409  if (!ent->inuse)
410  continue;
411 
412  level.current_entity = ent;
413 
414  VectorCopy (ent->s.origin, ent->s.old_origin);
415 
416  // if the ground entity moved, make sure we are still on it
417  if ((ent->groundentity) && (ent->groundentity->linkcount != ent->groundentity_linkcount))
418  {
419  ent->groundentity = NULL;
420  if ( !(ent->flags & (FL_SWIM|FL_FLY)) && (ent->svflags & SVF_MONSTER) )
421  {
422  M_CheckGround (ent);
423  }
424  }
425 
426  if (i > 0 && i <= maxclients->value)
427  {
429  continue;
430  }
431 
432  G_RunEntity (ent);
433  }
434 
435  // see if it is time to end a deathmatch
436  CheckDMRules ();
437 
438  // see if needpass needs updated
439  CheckNeedPass ();
440 
441  // build the playerstate_t structures for all players
443 }

Referenced by GetGameAPI().

◆ GetGameAPI()

◆ InitGame()

void InitGame ( void  )

Definition at line 152 of file g_save.c.

153 {
154  gi.dprintf ("==== InitGame ====\n");
155 
156  gun_x = gi.cvar ("gun_x", "0", 0);
157  gun_y = gi.cvar ("gun_y", "0", 0);
158  gun_z = gi.cvar ("gun_z", "0", 0);
159 
160  //FIXME: sv_ prefix is wrong for these
161  sv_rollspeed = gi.cvar ("sv_rollspeed", "200", 0);
162  sv_rollangle = gi.cvar ("sv_rollangle", "2", 0);
163  sv_maxvelocity = gi.cvar ("sv_maxvelocity", "2000", 0);
164  sv_gravity = gi.cvar ("sv_gravity", "800", 0);
165 
166  // noset vars
167  dedicated = gi.cvar ("dedicated", "0", CVAR_NOSET);
168 
169  // latched vars
170  sv_cheats = gi.cvar ("cheats", "0", CVAR_SERVERINFO|CVAR_LATCH);
171  gi.cvar ("gamename", GAMEVERSION , CVAR_SERVERINFO | CVAR_LATCH);
172  gi.cvar ("gamedate", __DATE__ , CVAR_SERVERINFO | CVAR_LATCH);
173 
174  maxclients = gi.cvar ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
175  maxspectators = gi.cvar ("maxspectators", "4", CVAR_SERVERINFO);
176  deathmatch = gi.cvar ("deathmatch", "0", CVAR_LATCH);
177  coop = gi.cvar ("coop", "0", CVAR_LATCH);
178  skill = gi.cvar ("skill", "1", CVAR_LATCH);
179  maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
180 
181  // change anytime vars
182  dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO);
183  fraglimit = gi.cvar ("fraglimit", "0", CVAR_SERVERINFO);
184  timelimit = gi.cvar ("timelimit", "0", CVAR_SERVERINFO);
185  password = gi.cvar ("password", "", CVAR_USERINFO);
186  spectator_password = gi.cvar ("spectator_password", "", CVAR_USERINFO);
187  needpass = gi.cvar ("needpass", "0", CVAR_SERVERINFO);
188  filterban = gi.cvar ("filterban", "1", 0);
189 
190  g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE);
191 
192  run_pitch = gi.cvar ("run_pitch", "0.002", 0);
193  run_roll = gi.cvar ("run_roll", "0.005", 0);
194  bob_up = gi.cvar ("bob_up", "0.005", 0);
195  bob_pitch = gi.cvar ("bob_pitch", "0.002", 0);
196  bob_roll = gi.cvar ("bob_roll", "0.002", 0);
197 
198  // flood control
199  flood_msgs = gi.cvar ("flood_msgs", "4", 0);
200  flood_persecond = gi.cvar ("flood_persecond", "4", 0);
201  flood_waitdelay = gi.cvar ("flood_waitdelay", "10", 0);
202 
203  // dm map list
204  sv_maplist = gi.cvar ("sv_maplist", "", 0);
205 
206  // items
207  InitItems ();
208 
210 
212 
213  // initialize all entities for this game
218 
219  // initialize all clients for this game
223 }

Referenced by GetGameAPI(), ReadField(), ReadLevel(), WriteField1(), and WriteLevel().

◆ ReadGame()

void ReadGame ( char *  filename)

Definition at line 494 of file g_save.c.

495 {
496  FILE *f;
497  int i;
498  char str[16];
499 
500  gi.FreeTags (TAG_GAME);
501 
502  f = fopen (filename, "rb");
503  if (!f)
504  gi.error ("Couldn't open %s", filename);
505 
506  fread (str, sizeof(str), 1, f);
507  if (strcmp (str, __DATE__))
508  {
509  fclose (f);
510  gi.error ("Savegame from an older version.\n");
511  }
512 
515 
516  fread (&game, sizeof(game), 1, f);
518  for (i=0 ; i<game.maxclients ; i++)
519  ReadClient (f, &game.clients[i]);
520 
521  fclose (f);
522 }

Referenced by GetGameAPI().

◆ ReadLevel()

void ReadLevel ( char *  filename)

Definition at line 689 of file g_save.c.

690 {
691  int entnum;
692  FILE *f;
693  int i;
694  void *base;
695  edict_t *ent;
696 
697  f = fopen (filename, "rb");
698  if (!f)
699  gi.error ("Couldn't open %s", filename);
700 
701  // free any dynamic memory allocated by loading the level
702  // base state
704 
705  // wipe all the entities
706  memset (g_edicts, 0, game.maxentities*sizeof(g_edicts[0]));
708 
709  // check edict size
710  fread (&i, sizeof(i), 1, f);
711  if (i != sizeof(edict_t))
712  {
713  fclose (f);
714  gi.error ("ReadLevel: mismatched edict size");
715  }
716 
717  // check function pointer base address
718  fread (&base, sizeof(base), 1, f);
719 #ifdef _WIN32
720  if (base != (void *)InitGame)
721  {
722  fclose (f);
723  gi.error ("ReadLevel: function pointers have moved");
724  }
725 #else
726  gi.dprintf("Function offsets %d\n", ((byte *)base) - ((byte *)InitGame));
727 #endif
728 
729  // load the level locals
730  ReadLevelLocals (f);
731 
732  // load all the entities
733  while (1)
734  {
735  if (fread (&entnum, sizeof(entnum), 1, f) != 1)
736  {
737  fclose (f);
738  gi.error ("ReadLevel: failed to read entnum");
739  }
740  if (entnum == -1)
741  break;
742  if (entnum >= globals.num_edicts)
743  globals.num_edicts = entnum+1;
744 
745  ent = &g_edicts[entnum];
746  ReadEdict (f, ent);
747 
748  // let the server rebuild world links for this ent
749  memset (&ent->area, 0, sizeof(ent->area));
750  gi.linkentity (ent);
751  }
752 
753  fclose (f);
754 
755  // mark all clients as unconnected
756  for (i=0 ; i<maxclients->value ; i++)
757  {
758  ent = &g_edicts[i+1];
759  ent->client = game.clients + i;
760  ent->client->pers.connected = false;
761  }
762 
763  // do any load time things at this point
764  for (i=0 ; i<globals.num_edicts ; i++)
765  {
766  ent = &g_edicts[i];
767 
768  if (!ent->inuse)
769  continue;
770 
771  // fire any cross-level triggers
772  if (ent->classname)
773  if (strcmp(ent->classname, "target_crosslevel_target") == 0)
774  ent->nextthink = level.time + ent->delay;
775  }
776 }

Referenced by GetGameAPI().

◆ RunEntity()

void RunEntity ( edict_t ent)

◆ ShutdownGame()

void ShutdownGame ( void  )

Definition at line 96 of file g_main.c.

97 {
98  gi.dprintf ("==== ShutdownGame ====\n");
99 
101  gi.FreeTags (TAG_GAME);
102 }

Referenced by GetGameAPI().

◆ SpawnEntities()

void SpawnEntities ( char *  mapname,
char *  entities,
char *  spawnpoint 
)

Definition at line 522 of file g_spawn.c.

523 {
524  edict_t *ent;
525  int inhibit;
526  char *com_token;
527  int i;
528  float skill_level;
529 
530  skill_level = floor (skill->value);
531  if (skill_level < 0)
532  skill_level = 0;
533  if (skill_level > 3)
534  skill_level = 3;
535  if (skill->value != skill_level)
536  gi.cvar_forceset("skill", va("%f", skill_level));
537 
538  SaveClientData ();
539 
541 
542  memset (&level, 0, sizeof(level));
543  memset (g_edicts, 0, game.maxentities * sizeof (g_edicts[0]));
544 
545  strncpy (level.mapname, mapname, sizeof(level.mapname)-1);
546  strncpy (game.spawnpoint, spawnpoint, sizeof(game.spawnpoint)-1);
547 
548  // set client fields on player ents
549  for (i=0 ; i<game.maxclients ; i++)
550  g_edicts[i+1].client = game.clients + i;
551 
552  ent = NULL;
553  inhibit = 0;
554 
555 // parse ents
556  while (1)
557  {
558  // parse the opening brace
559  com_token = COM_Parse (&entities);
560  if (!entities)
561  break;
562  if (com_token[0] != '{')
563  gi.error ("ED_LoadFromFile: found %s when expecting {",com_token);
564 
565  if (!ent)
566  ent = g_edicts;
567  else
568  ent = G_Spawn ();
569  entities = ED_ParseEdict (entities, ent);
570 
571  // yet another map hack
572  if (!Q_stricmp(level.mapname, "command") && !Q_stricmp(ent->classname, "trigger_once") && !Q_stricmp(ent->model, "*27"))
574 
575  // remove things (except the world) from different skill levels or deathmatch
576  if (ent != g_edicts)
577  {
578  if (deathmatch->value)
579  {
581  {
582  G_FreeEdict (ent);
583  inhibit++;
584  continue;
585  }
586  }
587  else
588  {
589  if ( /* ((coop->value) && (ent->spawnflags & SPAWNFLAG_NOT_COOP)) || */
590  ((skill->value == 0) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
591  ((skill->value == 1) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
592  (((skill->value == 2) || (skill->value == 3)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD))
593  )
594  {
595  G_FreeEdict (ent);
596  inhibit++;
597  continue;
598  }
599  }
600 
602  }
603 
604  ED_CallSpawn (ent);
605  }
606 
607  gi.dprintf ("%i entities inhibited\n", inhibit);
608 
609 #ifdef DEBUG
610  i = 1;
611  ent = EDICT_NUM(i);
612  while (i < globals.num_edicts) {
613  if (ent->inuse != 0 || ent->inuse != 1)
614  Com_DPrintf("Invalid entity %d\n", i);
615  i++, ent++;
616  }
617 #endif
618 
619  G_FindTeams ();
620 
621  PlayerTrail_Init ();
622 }

Referenced by GetGameAPI().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 145 of file g_main.c.

146 {
147  va_list argptr;
148  char text[1024];
149 
150  va_start (argptr, error);
151  vsprintf (text, error, argptr);
152  va_end (argptr);
153 
154  gi.error (ERR_FATAL, "%s", text);
155 }

◆ WriteGame()

void WriteGame ( char *  filename,
qboolean  autosave 
)

Definition at line 467 of file g_save.c.

468 {
469  FILE *f;
470  int i;
471  char str[16];
472 
473  if (!autosave)
474  SaveClientData ();
475 
476  f = fopen (filename, "wb");
477  if (!f)
478  gi.error ("Couldn't open %s", filename);
479 
480  memset (str, 0, sizeof(str));
481  strcpy (str, __DATE__);
482  fwrite (str, sizeof(str), 1, f);
483 
484  game.autosaved = autosave;
485  fwrite (&game, sizeof(game), 1, f);
486  game.autosaved = false;
487 
488  for (i=0 ; i<game.maxclients ; i++)
489  WriteClient (f, &game.clients[i]);
490 
491  fclose (f);
492 }

Referenced by GetGameAPI().

◆ WriteLevel()

void WriteLevel ( char *  filename)

Definition at line 635 of file g_save.c.

636 {
637  int i;
638  edict_t *ent;
639  FILE *f;
640  void *base;
641 
642  f = fopen (filename, "wb");
643  if (!f)
644  gi.error ("Couldn't open %s", filename);
645 
646  // write out edict size for checking
647  i = sizeof(edict_t);
648  fwrite (&i, sizeof(i), 1, f);
649 
650  // write out a function pointer for checking
651  base = (void *)InitGame;
652  fwrite (&base, sizeof(base), 1, f);
653 
654  // write out level_locals_t
655  WriteLevelLocals (f);
656 
657  // write out all the entities
658  for (i=0 ; i<globals.num_edicts ; i++)
659  {
660  ent = &g_edicts[i];
661  if (!ent->inuse)
662  continue;
663  fwrite (&i, sizeof(i), 1, f);
664  WriteEdict (f, ent);
665  }
666  i = -1;
667  fwrite (&i, sizeof(i), 1, f);
668 
669  fclose (f);
670 }

Referenced by GetGameAPI().

Variable Documentation

◆ bob_pitch

cvar_t* bob_pitch

Definition at line 64 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_roll

cvar_t* bob_roll

Definition at line 65 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_up

cvar_t* bob_up

Definition at line 63 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ coop

◆ deathmatch

cvar_t* deathmatch

Definition at line 35 of file g_main.c.

Referenced by BeginIntermission(), bfg_think(), Chaingun_Fire(), CheckDMRules(), ClientBegin(), ClientBeginServerFrame(), ClientConnect(), ClientObituary(), ClientUserinfoChanged(), Cmd_Give_f(), Cmd_God_f(), Cmd_Help_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_Score_f(), drop_make_touchable(), G_SetStats(), InitGame(), Machinegun_Fire(), MegaHealth_think(), monster_start(), MoveClientToIntermission(), P_FallingDamage(), Pickup_Adrenaline(), Pickup_Ammo(), Pickup_AncientHead(), Pickup_Armor(), Pickup_Bandolier(), Pickup_Health(), Pickup_Pack(), Pickup_PowerArmor(), Pickup_Powerup(), Pickup_Weapon(), player_die(), PlayerNoise(), PlayerTrail_Init(), PutClientInServer(), respawn(), rocket_touch(), SelectSpawnPoint(), SP_func_door(), SP_func_explosive(), SP_info_player_deathmatch(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_light(), SP_misc_actor(), SP_misc_deadsoldier(), SP_misc_explobox(), SP_misc_insane(), SP_monster_berserk(), SP_monster_boss2(), SP_monster_boss3_stand(), SP_monster_brain(), SP_monster_chick(), SP_monster_flipper(), SP_monster_floater(), SP_monster_flyer(), SP_monster_gladiator(), SP_monster_gunner(), SP_monster_hover(), SP_monster_infantry(), SP_monster_jorg(), SP_monster_makron(), SP_monster_medic(), SP_monster_mutant(), SP_monster_parasite(), SP_monster_soldier(), SP_monster_soldier_light(), SP_monster_soldier_ss(), SP_monster_supertank(), SP_monster_tank(), SP_point_combat(), SP_target_goal(), SP_target_help(), SP_target_lightramp(), SP_target_secret(), SP_turret_driver(), SP_worldspawn(), SpawnEntities(), SpawnItem(), T_Damage(), TossClientWeapon(), use_target_changelevel(), weapon_bfg_fire(), Weapon_Blaster_Fire(), Weapon_HyperBlaster_Fire(), weapon_railgun_fire(), and weapon_shotgun_fire().

◆ dedicated

cvar_t* dedicated

Definition at line 48 of file g_main.c.

◆ dmflags

◆ filterban

cvar_t* filterban

Definition at line 50 of file g_main.c.

Referenced by InitGame(), SV_FilterPacket(), and SVCmd_WriteIP_f().

◆ flood_msgs

cvar_t* flood_msgs

Definition at line 69 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_persecond

cvar_t* flood_persecond

Definition at line 70 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_waitdelay

cvar_t* flood_waitdelay

Definition at line 71 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ fraglimit

cvar_t* fraglimit

Definition at line 39 of file g_main.c.

Referenced by CheckDMRules(), InitGame(), and StartServerActionFunc().

◆ g_edicts

◆ g_select_empty

cvar_t* g_select_empty

Definition at line 47 of file g_main.c.

Referenced by InitGame(), and Use_Weapon().

◆ game

◆ gi

Definition at line 25 of file g_main.c.

Referenced by actor_dead(), actor_pain(), actor_use(), ai_run(), BecomeExplosion1(), BecomeExplosion2(), berserk_dead(), berserk_die(), berserk_fidget(), berserk_pain(), berserk_search(), berserk_sight(), berserk_swing(), bfg_explode(), bfg_think(), bfg_touch(), Blaster_Fire(), blaster_touch(), body_die(), Boss2_CheckAttack(), boss2_dead(), boss2_die(), boss2_pain(), boss2_search(), BossExplode(), brain_chest_open(), brain_dead(), brain_die(), brain_duck_down(), brain_duck_up(), brain_hit_left(), brain_hit_right(), brain_idle(), brain_pain(), brain_search(), brain_sight(), brain_swing_left(), brain_swing_right(), brain_tentacle_attack(), button_fire(), CanDamage(), Chaingun_Fire(), ChangeWeapon(), check_dodge(), CheckDMRules(), CheckNeedPass(), chick_dead(), chick_die(), chick_duck_down(), chick_duck_up(), chick_pain(), Chick_PreAttack1(), chick_sight(), ChickMoan(), ChickReload(), ChickSlash(), ClientBegin(), ClientBeginDeathmatch(), ClientCommand(), ClientConnect(), ClientDisconnect(), ClientEndServerFrame(), ClientObituary(), ClientThink(), ClientUserinfoChanged(), Cmd_Drop_f(), Cmd_Give_f(), Cmd_God_f(), Cmd_InvDrop_f(), Cmd_Inven_f(), Cmd_InvUse_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_PlayerList_f(), Cmd_Players_f(), Cmd_Say_f(), Cmd_Use_f(), Cmd_Wave_f(), Com_Printf(), commander_body_think(), commander_body_use(), CopyToBodyQue(), DeathmatchScoreboard(), DeathmatchScoreboardMessage(), door_go_down(), door_go_up(), door_hit_bottom(), door_hit_top(), door_touch(), door_use_areaportals(), DoRespawn(), Drop_Ammo(), Drop_Item(), Drop_Weapon(), droptofloor(), ED_CallSpawn(), ED_NewString(), ED_ParseEdict(), ED_ParseField(), ExitLevel(), FindTarget(), fire_bfg(), fire_blaster(), fire_grenade(), fire_grenade2(), fire_hit(), fire_lead(), fire_rail(), fire_rocket(), flipper_dead(), flipper_die(), flipper_pain(), flipper_preattack(), flipper_sight(), floater_dead(), floater_die(), floater_idle(), floater_pain(), floater_sight(), floater_wham(), floater_zap(), flyer_die(), flyer_idle(), flyer_pain(), flyer_pop_blades(), flyer_sight(), flyer_slash_left(), flyer_slash_right(), flymonster_start_go(), FoundTarget(), func_explosive_spawn(), func_train_find(), func_wall_use(), G_CopyString(), G_FindTeams(), G_FreeEdict(), G_PickTarget(), G_RunEntity(), G_SetClientSound(), G_SetStats(), G_Spawn(), G_TouchSolids(), G_TouchTriggers(), G_UseTargets(), GaldiatorMelee(), GetChaseTarget(), GetGameAPI(), gib_touch(), gladiator_attack(), gladiator_cleaver_swing(), gladiator_dead(), gladiator_die(), gladiator_idle(), gladiator_pain(), gladiator_search(), gladiator_sight(), Grenade_Explode(), Grenade_Touch(), gunner_dead(), gunner_die(), gunner_duck_down(), gunner_duck_up(), gunner_idlesound(), gunner_opengun(), gunner_pain(), gunner_search(), gunner_sight(), HelpComputer(), hover_dead(), hover_die(), hover_pain(), hover_search(), hover_sight(), hurt_touch(), hurt_use(), infantry_cock_gun(), infantry_dead(), infantry_die(), infantry_duck_down(), infantry_duck_up(), infantry_fidget(), infantry_pain(), infantry_sight(), infantry_smack(), infantry_swing(), InitGame(), InitTrigger(), insane_dead(), insane_die(), insane_fist(), insane_moan(), insane_pain(), insane_scream(), insane_shake(), jorg_attack(), Jorg_CheckAttack(), jorg_dead(), jorg_death_hit(), jorg_die(), jorg_idle(), jorg_pain(), jorg_search(), jorg_step_left(), jorg_step_right(), jorgBFG(), KillBox(), light_use(), M_CatagorizePosition(), M_CheckAttack(), M_CheckBottom(), M_CheckGround(), M_droptofloor(), M_FliesOn(), M_WorldEffects(), Machinegun_Fire(), makron_brainsplorch(), Makron_CheckAttack(), makron_dead(), makron_die(), makron_hit(), makron_pain(), makron_popup(), makron_prerailgun(), makron_step_left(), makron_step_right(), makron_taunt(), makron_torso(), makronBFG(), MakronPrecache(), medic_cable_attack(), medic_dead(), medic_die(), medic_duck_down(), medic_duck_up(), medic_hook_launch(), medic_hook_retract(), medic_idle(), medic_pain(), medic_search(), medic_sight(), misc_deadsoldier_die(), monster_fire_bfg(), monster_fire_blaster(), monster_fire_bullet(), monster_fire_grenade(), monster_fire_railgun(), monster_fire_rocket(), monster_fire_shotgun(), monster_start(), monster_start_go(), monster_triggered_spawn(), MoveClientToIntermission(), mutant_check_landing(), mutant_dead(), mutant_die(), mutant_hit_left(), mutant_hit_right(), mutant_idle(), mutant_jump_takeoff(), mutant_pain(), mutant_search(), mutant_sight(), mutant_step(), mutant_swing(), P_DamageFeedback(), P_WorldEffects(), parasite_dead(), parasite_die(), parasite_drain_attack(), parasite_launch(), parasite_pain(), parasite_reel_in(), parasite_scratch(), parasite_search(), parasite_sight(), parasite_tap(), plat_go_down(), plat_go_up(), plat_hit_bottom(), plat_hit_top(), plat_spawn_inside_trigger(), player_die(), PlayerNoise(), PM_trace(), point_combat_touch(), PrecacheItem(), PutClientInServer(), ReadField(), ReadGame(), ReadLevel(), respawn(), rocket_touch(), SelectSpawnPoint(), ServerCommand(), SetItemNames(), SetRespawn(), ShutdownGame(), soldier_cock(), soldier_dead(), soldier_die(), soldier_duck_down(), soldier_duck_up(), soldier_idle(), soldier_pain(), soldier_sight(), SP_func_button(), SP_func_clock(), SP_func_conveyor(), SP_func_door(), SP_func_door_rotating(), SP_func_door_secret(), SP_func_explosive(), SP_func_killbox(), SP_func_object(), SP_func_plat(), SP_func_rotating(), SP_func_timer(), SP_func_train(), SP_func_wall(), SP_func_water(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_light(), SP_light_mine1(), SP_light_mine2(), SP_misc_actor(), SP_misc_banner(), SP_misc_bigviper(), SP_misc_blackhole(), SP_misc_deadsoldier(), SP_misc_easterchick(), SP_misc_easterchick2(), SP_misc_eastertank(), SP_misc_explobox(), SP_misc_gib_arm(), SP_misc_gib_head(), SP_misc_gib_leg(), SP_misc_insane(), SP_misc_satellite_dish(), SP_misc_strogg_ship(), SP_misc_teleporter(), SP_misc_teleporter_dest(), SP_misc_viper(), SP_misc_viper_bomb(), SP_monster_berserk(), SP_monster_boss2(), SP_monster_boss3_stand(), SP_monster_brain(), SP_monster_chick(), SP_monster_commander_body(), SP_monster_flipper(), SP_monster_floater(), SP_monster_flyer(), SP_monster_gladiator(), SP_monster_gunner(), SP_monster_hover(), SP_monster_infantry(), SP_monster_jorg(), SP_monster_makron(), SP_monster_medic(), SP_monster_mutant(), SP_monster_parasite(), SP_monster_soldier(), SP_monster_soldier_light(), SP_monster_soldier_ss(), SP_monster_soldier_x(), SP_monster_supertank(), SP_monster_tank(), SP_path_corner(), SP_point_combat(), SP_target_actor(), SP_target_blaster(), SP_target_changelevel(), SP_target_character(), SP_target_earthquake(), SP_target_goal(), SP_target_help(), SP_target_lightramp(), SP_target_secret(), SP_target_speaker(), SP_trigger_gravity(), SP_trigger_hurt(), SP_trigger_key(), SP_trigger_multiple(), SP_trigger_once(), SP_trigger_push(), SP_turret_base(), SP_turret_breach(), SP_turret_driver(), SP_viewthing(), SP_worldspawn(), SpawnDamage(), SpawnEntities(), SpawnItem(), spectator_respawn(), StringToFilter(), supertank_dead(), supertank_die(), supertank_pain(), supertank_search(), SV_CalcBlend(), SV_FlyMove(), SV_movestep(), SV_Physics_Noclip(), SV_Physics_Pusher(), SV_Physics_Step(), SV_Physics_Toss(), SV_Push(), SV_PushEntity(), SV_RunThink(), SV_StepDirection(), SV_TestEntityPosition(), SVCmd_AddIP_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), Svcmd_Test_f(), SVCmd_WriteIP_f(), Sys_Error(), T_Damage(), tank_dead(), tank_die(), tank_footstep(), tank_idle(), tank_pain(), tank_sight(), tank_thud(), tank_windup(), TankStrike(), target_actor_touch(), target_earthquake_think(), target_explosion_explode(), target_laser_start(), target_laser_think(), target_lightramp_think(), target_lightramp_use(), teleporter_touch(), Think_SpawnDoorTrigger(), ThrowClientHead(), ThrowDebris(), ThrowGib(), ThrowHead(), Touch_Item(), train_next(), train_wait(), TreadSound(), trigger_counter_use(), trigger_elevator_init(), trigger_elevator_use(), trigger_enable(), trigger_key_use(), trigger_push_touch(), turret_breach_finish_init(), turret_breach_fire(), UpdateChaseCam(), Use_Areaportal(), Use_Boss3(), Use_Invulnerability(), Use_Item(), Use_PowerArmor(), Use_Quad(), use_target_blaster(), use_target_changelevel(), use_target_goal(), use_target_secret(), use_target_spawner(), Use_Target_Speaker(), use_target_splash(), Use_Target_Tent(), Use_Weapon(), visible(), walkmonster_start_go(), weapon_bfg_fire(), Weapon_Generic(), Weapon_Grenade(), weapon_grenadelauncher_fire(), Weapon_HyperBlaster_Fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), weapon_supershotgun_fire(), WriteField1(), WriteGame(), and WriteLevel().

◆ gib_on

cvar_t* gib_on

Definition at line 75 of file g_main.c.

◆ globals

◆ gun_x

cvar_t* gun_x

Definition at line 57 of file g_main.c.

Referenced by InitGame(), and SV_CalcGunOffset().

◆ gun_y

cvar_t* gun_y

Definition at line 58 of file g_main.c.

◆ gun_z

cvar_t* gun_z

Definition at line 59 of file g_main.c.

◆ level

Definition at line 24 of file g_main.c.

Referenced by CheckDMRules(), CreateTargetChangeLevel(), EndDMLevel(), ExitLevel(), and G_RunFrame().

◆ maxclients

cvar_t* maxclients

Definition at line 44 of file g_main.c.

Referenced by CheckDMRules(), ClientEndServerFrames(), and ExitLevel().

◆ maxentities

cvar_t* maxentities

Definition at line 46 of file g_main.c.

Referenced by InitGame().

◆ maxspectators

cvar_t* maxspectators

Definition at line 45 of file g_main.c.

Referenced by ClientConnect(), InitGame(), and spectator_respawn().

◆ meansOfDeath

int meansOfDeath

Definition at line 31 of file g_main.c.

Referenced by ClientObituary(), Cmd_Kill_f(), and T_Damage().

◆ needpass

cvar_t* needpass

Definition at line 43 of file g_main.c.

Referenced by InitGame().

◆ password

cvar_t* password

Definition at line 41 of file g_main.c.

Referenced by CheckNeedPass(), ClientConnect(), InitGame(), and spectator_respawn().

◆ run_pitch

cvar_t* run_pitch

Definition at line 61 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ run_roll

cvar_t* run_roll

Definition at line 62 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ skill

◆ sm_meat_index

int sm_meat_index

Definition at line 29 of file g_main.c.

Referenced by gib_touch(), and SP_worldspawn().

◆ snd_fry

int snd_fry

Definition at line 30 of file g_main.c.

Referenced by G_SetClientSound(), and SP_worldspawn().

◆ spectator_password

cvar_t* spectator_password

Definition at line 42 of file g_main.c.

Referenced by CheckNeedPass(), ClientConnect(), InitGame(), and spectator_respawn().

◆ st

◆ sv_cheats

cvar_t* sv_cheats

Definition at line 67 of file g_main.c.

Referenced by Cmd_Give_f(), Cmd_God_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), and InitGame().

◆ sv_gravity

cvar_t* sv_gravity

Definition at line 53 of file g_main.c.

Referenced by ClientThink(), InitGame(), SV_AddGravity(), and SV_Physics_Step().

◆ sv_maplist

cvar_t* sv_maplist

Definition at line 73 of file g_main.c.

Referenced by EndDMLevel(), and InitGame().

◆ sv_maxvelocity

cvar_t* sv_maxvelocity

Definition at line 52 of file g_main.c.

Referenced by InitGame(), and SV_CheckVelocity().

◆ sv_rollangle

cvar_t* sv_rollangle

Definition at line 56 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ sv_rollspeed

cvar_t* sv_rollspeed

Definition at line 55 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ timelimit

cvar_t* timelimit

Definition at line 40 of file g_main.c.

Referenced by CheckDMRules(), InitGame(), and StartServerActionFunc().

entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1175
gi
game_import_t gi
Definition: g_main.c:25
deathmatch
cvar_t * deathmatch
Definition: g_main.c:35
UpdateChaseCam
void UpdateChaseCam(edict_t *ent)
Definition: g_chase.c:22
MZ_LOGIN
#define MZ_LOGIN
Definition: q_shared.h:665
game_export_t::SpawnEntities
void(* SpawnEntities)(char *mapname, char *entstring, char *spawnpoint)
Definition: game.h:192
WriteLevel
void WriteLevel(char *filename)
Definition: g_save.c:635
game_import_t::dprintf
void(* dprintf)(char *fmt,...)
Definition: game.h:106
edict_s::s
entity_state_t s
Definition: g_local.h:964
Cmd_Inven_f
void Cmd_Inven_f(edict_t *ent)
Definition: g_cmds.c:466
edict_s::groundentity
edict_t * groundentity
Definition: g_local.h:1073
game
game_locals_t game
Definition: g_main.c:23
deathmatch
cvar_t * deathmatch
Definition: g_main.c:35
PlayerTrail_Init
void PlayerTrail_Init(void)
Definition: p_trail.c:49
MoveClientToIntermission
void MoveClientToIntermission(edict_t *client)
Definition: p_hud.c:32
game_export_t::ReadGame
void(* ReadGame)(char *filename)
Definition: game.h:199
globals
game_export_t globals
Definition: g_main.c:26
dedicated
cvar_t * dedicated
Definition: common.c:47
client_persistant_t::spectator
qboolean spectator
Definition: g_local.h:861
game_export_t::edict_size
int edict_size
Definition: game.h:230
value
GLfloat value
Definition: qgl_win.c:63
GAME_API_VERSION
#define GAME_API_VERSION
Definition: game.h:23
YAW
#define YAW
Definition: q_shared.h:66
run_roll
cvar_t * run_roll
Definition: g_main.c:62
ClientBeginServerFrame
void ClientBeginServerFrame(edict_t *ent)
Definition: p_client.c:1765
Info_Validate
qboolean Info_Validate(char *s)
Definition: q_shared.c:1366
gclient_s::v_angle
vec3_t v_angle
Definition: g_local.h:921
edict_s::model
char * model
Definition: g_local.h:998
game_locals_t::helpmessage1
char helpmessage1[512]
Definition: g_local.h:272
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:420
pm
pmove_t * pm
Definition: pmove.c:48
Cmd_Give_f
void Cmd_Give_f(edict_t *ent)
Definition: g_cmds.c:152
pmove_t::watertype
int watertype
Definition: q_shared.h:544
sv_rollspeed
cvar_t * sv_rollspeed
Definition: g_main.c:55
svc_muzzleflash
@ svc_muzzleflash
Definition: qcommon.h:208
G_RunEntity
void G_RunEntity(edict_t *ent)
Definition: g_phys.c:932
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:312
game_import_t::multicast
void(* multicast)(vec3_t origin, multicast_t to)
Definition: game.h:144
maxclients
cvar_t * maxclients
Definition: g_main.c:44
CheckNeedPass
void CheckNeedPass(void)
Definition: g_main.c:280
ClientThink
void ClientThink(edict_t *ent, usercmd_t *cmd)
Definition: p_client.c:1580
ClientUserinfoChanged
void ClientUserinfoChanged(edict_t *ent, char *userinfo)
Definition: p_client.c:1371
client_persistant_t::connected
qboolean connected
Definition: g_local.h:833
run_pitch
cvar_t * run_pitch
Definition: g_main.c:61
FRAMETIME
#define FRAMETIME
Definition: g_local.h:73
pmove_t::viewheight
float viewheight
Definition: q_shared.h:539
PMF_NO_PREDICTION
#define PMF_NO_PREDICTION
Definition: q_shared.h:483
Cmd_Use_f
void Cmd_Use_f(edict_t *ent)
Definition: g_cmds.c:396
game_import_t::cvar
cvar_t *(* cvar)(char *var_name, char *value, int flags)
Definition: game.h:162
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:473
gclient_s::buttons
int buttons
Definition: g_local.h:895
game_export_t::edicts
struct edict_s * edicts
Definition: game.h:229
ClientConnect
qboolean ClientConnect(edict_t *ent, char *userinfo)
Definition: p_client.c:1440
cvar_s::modified
qboolean modified
Definition: q_shared.h:323
password
cvar_t * password
Definition: g_main.c:41
MOVETYPE_NOCLIP
@ MOVETYPE_NOCLIP
Definition: g_local.h:189
game_export_t::Shutdown
void(* Shutdown)(void)
Definition: game.h:189
SPAWNFLAG_NOT_EASY
#define SPAWNFLAG_NOT_EASY
Definition: g_local.h:50
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
game_export_t::apiversion
int apiversion
Definition: game.h:183
edict_s::linkcount
int linkcount
Definition: g_local.h:971
edict_s::map
char * map
Definition: g_local.h:1059
gun_x
cvar_t * gun_x
Definition: g_main.c:57
game_export_t::max_edicts
int max_edicts
Definition: game.h:232
com_token
char com_token[MAX_TOKEN_CHARS]
Definition: q_shared.c:1063
cvar_s::string
char * string
Definition: q_shared.h:320
flood_msgs
cvar_t * flood_msgs
Definition: g_main.c:69
edict_s::inuse
qboolean inuse
Definition: g_local.h:970
ClientBegin
void ClientBegin(edict_t *ent)
Definition: p_client.c:1305
pmove_state_t::gravity
short gravity
Definition: q_shared.h:498
ExitLevel
void ExitLevel(void)
Definition: g_main.c:351
i
int i
Definition: q_shared.c:305
G_TouchTriggers
void G_TouchTriggers(edict_t *ent)
Definition: g_utils.c:475
Cmd_WeapLast_f
void Cmd_WeapLast_f(edict_t *ent)
Definition: g_cmds.c:595
ClientEndServerFrames
void ClientEndServerFrames(void)
Definition: g_main.c:179
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:45
pmove_t::waterlevel
int waterlevel
Definition: q_shared.h:545
SV_FilterPacket
qboolean SV_FilterPacket(char *from)
Definition: g_svcmds.c:123
maxspectators
cvar_t * maxspectators
Definition: g_main.c:45
game_export_t::Init
void(* Init)(void)
Definition: game.h:188
edict_s::client
struct gclient_s * client
Definition: g_local.h:965
game_import_t::sound
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
Definition: game.h:109
game_export_t::ClientThink
void(* ClientThink)(edict_t *ent, usercmd_t *cmd)
Definition: game.h:211
WriteClient
void WriteClient(FILE *f, gclient_t *client)
Definition: g_save.c:410
PITCH
#define PITCH
Definition: q_shared.h:65
Think_Weapon
void Think_Weapon(edict_t *ent)
Definition: p_weapon.c:282
FOFS
#define FOFS(x)
Definition: g_local.h:504
ClientUserinfoChanged
void ClientUserinfoChanged(edict_t *ent, char *userinfo)
Definition: p_client.c:1371
client_respawn_t::spectator
qboolean spectator
Definition: g_local.h:872
maxentities
cvar_t * maxentities
Definition: g_main.c:46
ShutdownGame
void ShutdownGame(void)
Definition: g_main.c:96
TAG_LEVEL
#define TAG_LEVEL
Definition: g_local.h:77
client_persistant_t::userinfo
char userinfo[MAX_INFO_STRING]
Definition: g_local.h:829
gun_y
cvar_t * gun_y
Definition: g_local.h:530
edict_s::mins
vec3_t mins
Definition: g_local.h:984
pmove_t::maxs
vec3_t maxs
Definition: q_shared.h:541
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:495
player_state_t::fov
float fov
Definition: q_shared.h:1216
SPAWNFLAG_NOT_MEDIUM
#define SPAWNFLAG_NOT_MEDIUM
Definition: g_local.h:51
game_locals_t::spawnpoint
char spawnpoint[512]
Definition: g_local.h:281
g_edicts
edict_t * g_edicts
Definition: g_main.c:33
ATTN_NORM
#define ATTN_NORM
Definition: q_shared.h:1019
edict_s::groundentity_linkcount
int groundentity_linkcount
Definition: g_local.h:1074
password
cvar_t * password
Definition: g_main.c:41
IT_WEAPON
#define IT_WEAPON
Definition: g_local.h:214
game_export_t::ClientConnect
qboolean(* ClientConnect)(edict_t *ent, char *userinfo)
Definition: game.h:206
DF_FIXED_FOV
#define DF_FIXED_FOV
Definition: q_shared.h:1063
BUTTON_ATTACK
#define BUTTON_ATTACK
Definition: q_shared.h:507
edict_s::movetype
int movetype
Definition: g_local.h:995
game_export_t::ClientDisconnect
void(* ClientDisconnect)(edict_t *ent)
Definition: game.h:209
BeginIntermission
void BeginIntermission(edict_t *targ)
Definition: p_hud.c:73
CVAR_SERVERINFO
#define CVAR_SERVERINFO
Definition: q_shared.h:311
game_export_t::ClientUserinfoChanged
void(* ClientUserinfoChanged)(edict_t *ent, char *userinfo)
Definition: game.h:208
FL_SWIM
#define FL_SWIM
Definition: g_local.h:58
j
GLint j
Definition: qgl_win.c:150
SelectPrevItem
void SelectPrevItem(edict_t *ent, int itflags)
Definition: g_cmds.c:98
G_InitEdict
void G_InitEdict(edict_t *e)
Definition: g_utils.c:401
ClientDisconnect
void ClientDisconnect(edict_t *ent)
Definition: p_client.c:1514
gclient_s::pers
client_persistant_t pers
Definition: g_local.h:884
level_locals_t::current_entity
edict_t * current_entity
Definition: g_local.h:337
va
char * va(char *format,...)
Definition: q_shared.c:1050
msg
cvar_t * msg
Definition: cl_main.c:98
game_locals_t::helpmessage2
char helpmessage2[512]
Definition: g_local.h:273
game_export_t::ClientCommand
void(* ClientCommand)(edict_t *ent)
Definition: game.h:210
Cmd_Noclip_f
void Cmd_Noclip_f(edict_t *ent)
Definition: g_cmds.c:364
PM_GIB
@ PM_GIB
Definition: q_shared.h:472
ReadClient
void ReadClient(FILE *f, gclient_t *client)
Definition: g_save.c:441
Cmd_God_f
void Cmd_God_f(edict_t *ent)
Definition: g_cmds.c:308
edict_s::svflags
int svflags
Definition: g_local.h:983
gi
game_import_t gi
Definition: g_main.c:25
CHAN_VOICE
#define CHAN_VOICE
Definition: q_shared.h:1009
game_import_t::cvar_set
cvar_t *(* cvar_set)(char *var_name, char *value)
Definition: game.h:163
gclient_s::weapon_thunk
qboolean weapon_thunk
Definition: g_local.h:899
edict_s::classname
char * classname
Definition: g_local.h:1005
ED_CallSpawn
void ED_CallSpawn(edict_t *ent)
Definition: g_spawn.c:278
Cmd_Players_f
void Cmd_Players_f(edict_t *ent)
Definition: g_cmds.c:694
pmove_t::trace
trace_t(* trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
Definition: q_shared.h:548
edict_s
Definition: g_local.h:962
PMF_JUMP_HELD
#define PMF_JUMP_HELD
Definition: q_shared.h:478
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:452
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:492
timelimit
cvar_t * timelimit
Definition: g_main.c:40
client_persistant_t::weapon
gitem_t * weapon
Definition: g_local.h:852
ReadLevel
void ReadLevel(char *filename)
Definition: g_save.c:689
Cmd_PutAway_f
void Cmd_PutAway_f(edict_t *ent)
Definition: g_cmds.c:664
edict_s::viewheight
int viewheight
Definition: g_local.h:1061
ROLL
#define ROLL
Definition: q_shared.h:67
gun_z
cvar_t * gun_z
Definition: g_local.h:530
pmove_t::groundentity
struct edict_s * groundentity
Definition: q_shared.h:543
game_import_t::cvar_forceset
cvar_t *(* cvar_forceset)(char *var_name, char *value)
Definition: game.h:164
game_import_t::configstring
void(* configstring)(int num, char *string)
Definition: game.h:116
player_state_t::viewangles
vec3_t viewangles
Definition: q_shared.h:1204
game_import_t::soundindex
int(* soundindex)(char *name)
Definition: game.h:122
edict_s::spawnflags
int spawnflags
Definition: g_local.h:1006
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1200
DF_SAME_LEVEL
#define DF_SAME_LEVEL
Definition: q_shared.h:1053
game_import_t::pointcontents
int(* pointcontents)(vec3_t point)
Definition: game.h:129
ServerCommand
void ServerCommand(void)
Definition: g_svcmds.c:282
maxclients
cvar_t * maxclients
Definition: g_main.c:44
t
GLdouble t
Definition: qgl_win.c:328
Cmd_Wave_f
void Cmd_Wave_f(edict_t *ent)
Definition: g_cmds.c:737
client_persistant_t::netname
char netname[16]
Definition: g_local.h:830
Info_ValueForKey
char * Info_ValueForKey(char *s, char *key)
Definition: q_shared.c:1266
MZ_LOGOUT
#define MZ_LOGOUT
Definition: q_shared.h:666
GetChaseTarget
void GetChaseTarget(edict_t *ent)
Definition: g_chase.c:159
CS_PLAYERSKINS
#define CS_PLAYERSKINS
Definition: q_shared.h:1141
edict_s::deadflag
int deadflag
Definition: g_local.h:1054
sv_maplist
cvar_t * sv_maplist
Definition: g_main.c:73
BUTTON_ANY
#define BUTTON_ANY
Definition: q_shared.h:509
SpawnEntities
void SpawnEntities(char *mapname, char *entities, char *spawnpoint)
Definition: g_spawn.c:522
client_respawn_t::cmd_angles
vec3_t cmd_angles
Definition: g_local.h:870
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
spectator_password
cvar_t * spectator_password
Definition: g_main.c:42
game_locals_t::clients
gclient_t * clients
Definition: g_local.h:277
edict_s::nextthink
float nextthink
Definition: g_local.h:1036
gclient_s::killer_yaw
float killer_yaw
Definition: g_local.h:911
cvar_s::value
float value
Definition: q_shared.h:324
ED_ParseEdict
char * ED_ParseEdict(char *data, edict_t *ent)
Definition: g_spawn.c:416
ReadLevelLocals
void ReadLevelLocals(FILE *f)
Definition: g_save.c:617
game
game_locals_t game
Definition: g_main.c:23
flood_persecond
cvar_t * flood_persecond
Definition: g_main.c:70
PM_trace
trace_t PM_trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
Definition: p_client.c:1547
flood_waitdelay
cvar_t * flood_waitdelay
Definition: g_main.c:71
PRINT_HIGH
#define PRINT_HIGH
Definition: q_shared.h:92
game_export_t::ServerCommand
void(* ServerCommand)(void)
Definition: game.h:219
pmove_state_t::delta_angles
short delta_angles[3]
Definition: q_shared.h:499
Cmd_WeapPrev_f
void Cmd_WeapPrev_f(edict_t *ent)
Definition: g_cmds.c:523
edict_t
struct edict_s edict_t
Definition: game.h:52
pm_passent
edict_t * pm_passent
Definition: p_client.c:1544
gclient_s::ps
player_state_t ps
Definition: g_local.h:880
edict_s::watertype
int watertype
Definition: g_local.h:1093
level_locals_t::nextmap
char nextmap[MAX_QPATH]
Definition: g_local.h:308
NULL
#define NULL
Definition: q_shared.h:60
Cmd_InvDrop_f
void Cmd_InvDrop_f(edict_t *ent)
Definition: g_cmds.c:622
globals
game_export_t globals
Definition: g_main.c:26
filterban
cvar_t * filterban
Definition: g_main.c:50
ReadEdict
void ReadEdict(FILE *f, edict_t *ent)
Definition: g_save.c:598
WriteLevelLocals
void WriteLevelLocals(FILE *f)
Definition: g_save.c:566
edict_s::solid
solid_t solid
Definition: g_local.h:986
CVAR_LATCH
#define CVAR_LATCH
Definition: q_shared.h:314
level
level_locals_t level
Definition: g_main.c:24
game_import_t::TagMalloc
void *(* TagMalloc)(int size, int tag)
Definition: game.h:157
Cmd_Score_f
void Cmd_Score_f(edict_t *ent)
Definition: p_hud.c:276
pmove_t::touchents
struct edict_s * touchents[MAXTOUCH]
Definition: q_shared.h:536
g_edicts
edict_t * g_edicts
Definition: g_main.c:33
game_export_t::ReadLevel
void(* ReadLevel)(char *filename)
Definition: game.h:204
pmove_t::numtouch
int numtouch
Definition: q_shared.h:535
Cmd_PlayerList_f
void Cmd_PlayerList_f(edict_t *ent)
Definition: g_cmds.c:873
GAMEVERSION
#define GAMEVERSION
Definition: g_local.h:31
EndDMLevel
void EndDMLevel(void)
Definition: g_main.c:221
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:471
bob_up
cvar_t * bob_up
Definition: g_main.c:63
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1192
skill
cvar_t * skill
Definition: g_main.c:38
usercmd_s::upmove
short upmove
Definition: q_shared.h:518
SOLID_NOT
@ SOLID_NOT
Definition: game.h:35
level_locals_t::framenum
int framenum
Definition: g_local.h:303
Cmd_InvUse_f
void Cmd_InvUse_f(edict_t *ent)
Definition: g_cmds.c:497
game_import_t::Pmove
void(* Pmove)(pmove_t *pmove)
Definition: game.h:141
edict_s::velocity
vec3_t velocity
Definition: g_local.h:1024
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
M_CheckGround
void M_CheckGround(edict_t *ent)
Definition: g_monster.c:141
game_import_t::unlinkentity
void(* unlinkentity)(edict_t *ent)
Definition: game.h:139
game_locals_t::autosaved
qboolean autosaved
Definition: g_local.h:293
level_locals_t::exitintermission
int exitintermission
Definition: g_local.h:313
level_locals_t::time
float time
Definition: g_local.h:304
game_import_t::WriteShort
void(* WriteShort)(int c)
Definition: game.h:148
Cmd_Kill_f
void Cmd_Kill_f(edict_t *ent)
Definition: g_cmds.c:648
dmflags
cvar_t * dmflags
Definition: g_main.c:37
Cmd_Help_f
void Cmd_Help_f(edict_t *ent)
Definition: p_hud.c:346
game_import_t::error
void(* error)(char *fmt,...)
Definition: game.h:118
CheckDMRules
void CheckDMRules(void)
Definition: g_main.c:306
Info_SetValueForKey
void Info_SetValueForKey(char *s, char *key, char *value)
Definition: q_shared.c:1375
edict_s::light_level
int light_level
Definition: g_local.h:1100
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
coop
cvar_t * coop
Definition: g_main.c:36
G_RunFrame
void G_RunFrame(void)
Definition: g_main.c:383
game_export_t::RunFrame
void(* RunFrame)(void)
Definition: game.h:213
level_locals_t::intermissiontime
float intermissiontime
Definition: g_local.h:311
timelimit
cvar_t * timelimit
Definition: g_main.c:40
g_select_empty
cvar_t * g_select_empty
Definition: g_main.c:47
PM_SPECTATOR
@ PM_SPECTATOR
Definition: q_shared.h:469
game_import_t::AddCommandString
void(* AddCommandString)(char *text)
Definition: game.h:173
game_export_t::WriteLevel
void(* WriteLevel)(char *filename)
Definition: game.h:203
SPAWNFLAG_NOT_DEATHMATCH
#define SPAWNFLAG_NOT_DEATHMATCH
Definition: g_local.h:53
SPAWNFLAG_NOT_HARD
#define SPAWNFLAG_NOT_HARD
Definition: g_local.h:52
CreateTargetChangeLevel
edict_t * CreateTargetChangeLevel(char *map)
Definition: g_main.c:203
level_locals_t::changemap
char * changemap
Definition: g_local.h:312
InitGame
void InitGame(void)
Definition: g_save.c:152
TAG_GAME
#define TAG_GAME
Definition: g_local.h:76
bob_pitch
cvar_t * bob_pitch
Definition: g_main.c:64
PNOISE_SELF
#define PNOISE_SELF
Definition: g_local.h:180
ClientEndServerFrame
void ClientEndServerFrame(edict_t *ent)
Definition: p_view.c:958
sv_cheats
cvar_t * sv_cheats
Definition: g_main.c:67
ClientCommand
void ClientCommand(edict_t *ent)
Definition: g_cmds.c:909
gclient_s::oldbuttons
int oldbuttons
Definition: g_local.h:896
game_import_t::WriteByte
void(* WriteByte)(int c)
Definition: game.h:147
needpass
cvar_t * needpass
Definition: g_main.c:43
level
GLint level
Definition: qgl_win.c:116
bob_roll
cvar_t * bob_roll
Definition: g_main.c:65
SHORT2ANGLE
#define SHORT2ANGLE(x)
Definition: q_shared.h:1117
gclient_s::old_pmove
pmove_state_t old_pmove
Definition: g_local.h:886
edict_s::flags
int flags
Definition: g_local.h:996
pmove_t::s
pmove_state_t s
Definition: q_shared.h:528
fraglimit
cvar_t * fraglimit
Definition: g_main.c:39
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:310
ChaseNext
void ChaseNext(edict_t *ent)
Definition: g_chase.c:111
pmove_t::cmd
usercmd_t cmd
Definition: q_shared.h:531
edict_s::maxs
vec3_t maxs
Definition: g_local.h:984
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
PlayerNoise
void PlayerNoise(edict_t *who, vec3_t where, int type)
Definition: p_weapon.c:58
SPAWNFLAG_NOT_COOP
#define SPAWNFLAG_NOT_COOP
Definition: g_local.h:54
game_import_t::FreeTags
void(* FreeTags)(int tag)
Definition: game.h:159
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
InitItems
void InitItems(void)
Definition: g_items.c:2186
FL_FLY
#define FL_FLY
Definition: g_local.h:57
pmove_t::mins
vec3_t mins
Definition: q_shared.h:541
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:155
ReadGame
void ReadGame(char *filename)
Definition: g_save.c:494
SVF_MONSTER
#define SVF_MONSTER
Definition: game.h:29
edict_s::touch
void(* touch)(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_local.h:1040
PutClientInServer
void PutClientInServer(edict_t *ent)
Definition: p_client.c:1097
sv_maplist
cvar_t * sv_maplist
Definition: g_main.c:73
Cmd_WeapNext_f
void Cmd_WeapNext_f(edict_t *ent)
Definition: g_cmds.c:559
SelectNextItem
void SelectNextItem(edict_t *ent, int itflags)
Definition: g_cmds.c:66
sv_rollangle
cvar_t * sv_rollangle
Definition: g_main.c:56
gclient_s::chase_target
edict_t * chase_target
Definition: g_local.h:957
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:494
sv_gravity
cvar_t * sv_gravity
Definition: g_main.c:53
InitGame
void InitGame(void)
Definition: g_save.c:152
Cmd_Say_f
void Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
Definition: g_cmds.c:788
Cmd_Notarget_f
void Cmd_Notarget_f(edict_t *ent)
Definition: g_cmds.c:337
EDICT_NUM
#define EDICT_NUM(n)
Definition: server.h:69
game_export_t::ClientBegin
void(* ClientBegin)(edict_t *ent)
Definition: game.h:207
G_FindTeams
void G_FindTeams(void)
Definition: g_spawn.c:472
ANGLE2SHORT
#define ANGLE2SHORT(x)
Definition: q_shared.h:1116
PM_NORMAL
@ PM_NORMAL
Definition: q_shared.h:468
sv_maxvelocity
cvar_t * sv_maxvelocity
Definition: g_main.c:52
pmove_t::viewangles
vec3_t viewangles
Definition: q_shared.h:538
dmflags
cvar_t * dmflags
Definition: g_main.c:37
edict_s::waterlevel
int waterlevel
Definition: g_local.h:1094
edict_s::delay
float delay
Definition: g_local.h:1088
spectator_password
cvar_t * spectator_password
Definition: g_main.c:42
client_persistant_t::hand
int hand
Definition: g_local.h:831
edict_s::area
link_t area
Definition: g_local.h:974
SaveClientData
void SaveClientData(void)
Definition: p_client.c:650
client_persistant_t::max_health
int max_health
Definition: g_local.h:838
game_locals_t::maxentities
int maxentities
Definition: g_local.h:285
fraglimit
cvar_t * fraglimit
Definition: g_main.c:39
level_locals_t::mapname
char mapname[MAX_QPATH]
Definition: g_local.h:307
WriteEdict
void WriteEdict(FILE *f, edict_t *ent)
Definition: g_save.c:534
gclient_s
Definition: g_local.h:877
InitClientResp
void InitClientResp(gclient_t *client)
Definition: p_client.c:633
game_import_t::linkentity
void(* linkentity)(edict_t *ent)
Definition: game.h:138
game_export_t::WriteGame
void(* WriteGame)(char *filename, qboolean autosave)
Definition: game.h:198
pmove_t::pointcontents
int(* pointcontents)(vec3_t point)
Definition: q_shared.h:549
ClientBeginDeathmatch
void ClientBeginDeathmatch(edict_t *ent)
Definition: p_client.c:1268
gclient_s::latched_buttons
int latched_buttons
Definition: g_local.h:897
cl
client_state_t cl
Definition: cl_main.c:106
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:496
MULTICAST_PVS
@ MULTICAST_PVS
Definition: q_shared.h:111
pmove_t::snapinitial
qboolean snapinitial
Definition: q_shared.h:532
AI_SetSightClient
void AI_SetSightClient(void)
Definition: g_ai.c:50
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
pmove_t
Definition: q_shared.h:525
IT_POWERUP
#define IT_POWERUP
Definition: g_local.h:219
Cmd_Drop_f
void Cmd_Drop_f(edict_t *ent)
Definition: g_cmds.c:432
InitClientPersistant
void InitClientPersistant(gclient_t *client)
Definition: p_client.c:607
WriteGame
void WriteGame(char *filename, qboolean autosave)
Definition: g_save.c:467
game_export_t::num_edicts
int num_edicts
Definition: game.h:231
gclient_s::resp
client_respawn_t resp
Definition: g_local.h:885
game_import_t::argv
char *(* argv)(int n)
Definition: game.h:168
edict_s::health
int health
Definition: g_local.h:1051
game_import_t::bprintf
void(* bprintf)(int printlevel, char *fmt,...)
Definition: game.h:105
game_locals_t::maxclients
int maxclients
Definition: g_local.h:284