vkQuake2 doxygen  1.0 dev
g_utils.c File Reference
#include "g_local.h"

Go to the source code of this file.

Macros

#define MAXCHOICES   8
 

Functions

void G_ProjectSource (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
 
edict_tG_Find (edict_t *from, int fieldofs, char *match)
 
edict_tfindradius (edict_t *from, vec3_t org, float rad)
 
edict_tG_PickTarget (char *targetname)
 
void Think_Delay (edict_t *ent)
 
void G_UseTargets (edict_t *ent, edict_t *activator)
 
float * tv (float x, float y, float z)
 
char * vtos (vec3_t v)
 
void G_SetMovedir (vec3_t angles, vec3_t movedir)
 
float vectoyaw (vec3_t vec)
 
void vectoangles (vec3_t value1, vec3_t angles)
 
char * G_CopyString (char *in)
 
void G_InitEdict (edict_t *e)
 
edict_tG_Spawn (void)
 
void G_FreeEdict (edict_t *ed)
 
void G_TouchTriggers (edict_t *ent)
 
void G_TouchSolids (edict_t *ent)
 
qboolean KillBox (edict_t *ent)
 

Variables

vec3_t VEC_UP = {0, -1, 0}
 
vec3_t MOVEDIR_UP = {0, 0, 1}
 
vec3_t VEC_DOWN = {0, -2, 0}
 
vec3_t MOVEDIR_DOWN = {0, 0, -1}
 

Macro Definition Documentation

◆ MAXCHOICES

#define MAXCHOICES   8

Definition at line 116 of file g_utils.c.

Function Documentation

◆ findradius()

edict_t* findradius ( edict_t from,
vec3_t  org,
float  rad 
)

Definition at line 78 of file g_utils.c.

79 {
80  vec3_t eorg;
81  int j;
82 
83  if (!from)
84  from = g_edicts;
85  else
86  from++;
87  for ( ; from < &g_edicts[globals.num_edicts]; from++)
88  {
89  if (!from->inuse)
90  continue;
91  if (from->solid == SOLID_NOT)
92  continue;
93  for (j=0 ; j<3 ; j++)
94  eorg[j] = org[j] - (from->s.origin[j] + (from->mins[j] + from->maxs[j])*0.5);
95  if (VectorLength(eorg) > rad)
96  continue;
97  return from;
98  }
99 
100  return NULL;
101 }

Referenced by bfg_explode(), bfg_think(), medic_FindDeadMonster(), and T_RadiusDamage().

◆ G_CopyString()

char* G_CopyString ( char *  in)

Definition at line 391 of file g_utils.c.

392 {
393  char *out;
394 
395  out = gi.TagMalloc ((int)strlen(in)+1, TAG_LEVEL);
396  strcpy (out, in);
397  return out;
398 }

◆ G_Find()

edict_t* G_Find ( edict_t from,
int  fieldofs,
char *  match 
)

Definition at line 45 of file g_utils.c.

46 {
47  char *s;
48 
49  if (!from)
50  from = g_edicts;
51  else
52  from++;
53 
54  for ( ; from < &g_edicts[globals.num_edicts] ; from++)
55  {
56  if (!from->inuse)
57  continue;
58  s = *(char **) ((byte *)from + fieldofs);
59  if (!s)
60  continue;
61  if (!Q_stricmp (s, match))
62  return from;
63  }
64 
65  return NULL;
66 }

Referenced by BeginIntermission(), door_use_areaportals(), EndDMLevel(), func_clock_think(), G_PickTarget(), G_UseTargets(), misc_viper_bomb_use(), monster_start_go(), SelectCoopSpawnPoint(), SelectFarthestDeathmatchSpawnPoint(), SelectRandomDeathmatchSpawnPoint(), SelectSpawnPoint(), SP_FixCoopSpots(), target_laser_start(), target_lightramp_use(), and teleporter_touch().

◆ G_FreeEdict()

void G_FreeEdict ( edict_t ed)

Definition at line 452 of file g_utils.c.

453 {
454  gi.unlinkentity (ed); // unlink from world
455 
456  if ((ed - g_edicts) <= (maxclients->value + BODY_QUEUE_SIZE))
457  {
458 // gi.dprintf("tried to free special edict\n");
459  return;
460  }
461 
462  memset (ed, 0, sizeof(*ed));
463  ed->classname = "freed";
464  ed->freetime = level.time;
465  ed->inuse = false;
466 }

Referenced by ai_run(), BecomeExplosion1(), BecomeExplosion2(), bfg_explode(), bfg_touch(), blaster_touch(), Cmd_Give_f(), debris_die(), Drop_Ammo(), drop_make_touchable(), droptofloor(), fire_bfg(), fire_blaster(), fire_rocket(), func_explosive_explode(), G_UseTargets(), gib_die(), gib_think(), Grenade_Explode(), Grenade_Touch(), MegaHealth_think(), misc_blackhole_use(), monster_start(), multi_trigger(), rocket_touch(), SP_func_clock(), SP_func_explosive(), SP_info_null(), SP_info_player_coop(), 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_gib_arm(), SP_misc_gib_head(), SP_misc_gib_leg(), SP_misc_insane(), SP_misc_strogg_ship(), SP_misc_teleporter(), SP_misc_viper(), 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_path_corner(), SP_point_combat(), SP_target_changelevel(), SP_target_goal(), SP_target_help(), SP_target_lightramp(), SP_target_secret(), SP_trigger_gravity(), SP_turret_driver(), SpawnEntities(), SpawnItem(), target_crosslevel_target_think(), target_lightramp_use(), Think_Delay(), ThrowDebris(), ThrowGib(), ThrowHead(), TossClientWeapon(), Touch_Item(), trigger_crosslevel_trigger_use(), trigger_push_touch(), turret_breach_finish_init(), Use_Boss3(), use_target_goal(), and use_target_secret().

◆ G_InitEdict()

void G_InitEdict ( edict_t e)

Definition at line 401 of file g_utils.c.

402 {
403  e->inuse = true;
404  e->classname = "noclass";
405  e->gravity = 1.0;
406  e->s.number = e - g_edicts;
407 }

Referenced by ClientBegin(), ClientBeginDeathmatch(), and G_Spawn().

◆ G_PickTarget()

edict_t* G_PickTarget ( char *  targetname)

Definition at line 118 of file g_utils.c.

119 {
120  edict_t *ent = NULL;
121  int num_choices = 0;
122  edict_t *choice[MAXCHOICES];
123 
124  if (!targetname)
125  {
126  gi.dprintf("G_PickTarget called with NULL targetname\n");
127  return NULL;
128  }
129 
130  while(1)
131  {
132  ent = G_Find (ent, FOFS(targetname), targetname);
133  if (!ent)
134  break;
135  choice[num_choices++] = ent;
136  if (num_choices == MAXCHOICES)
137  break;
138  }
139 
140  if (!num_choices)
141  {
142  gi.dprintf("G_PickTarget: target %s not found\n", targetname);
143  return NULL;
144  }
145 
146  return choice[rand() % num_choices];
147 }

Referenced by actor_use(), FoundTarget(), func_train_find(), monster_start_go(), path_corner_touch(), point_combat_touch(), target_actor_touch(), train_next(), trigger_elevator_init(), trigger_elevator_use(), turret_breach_finish_init(), and turret_driver_link().

◆ G_ProjectSource()

void G_ProjectSource ( vec3_t  point,
vec3_t  distance,
vec3_t  forward,
vec3_t  right,
vec3_t  result 
)

◆ G_SetMovedir()

void G_SetMovedir ( vec3_t  angles,
vec3_t  movedir 
)

Definition at line 314 of file g_utils.c.

315 {
316  if (VectorCompare (angles, VEC_UP))
317  {
318  VectorCopy (MOVEDIR_UP, movedir);
319  }
320  else if (VectorCompare (angles, VEC_DOWN))
321  {
322  VectorCopy (MOVEDIR_DOWN, movedir);
323  }
324  else
325  {
326  AngleVectors (angles, movedir, NULL, NULL);
327  }
328 
329  VectorClear (angles);
330 }

Referenced by InitTrigger(), SP_func_button(), SP_func_door(), SP_func_water(), SP_target_actor(), SP_target_blaster(), SP_target_spawner(), SP_target_splash(), SP_trigger_multiple(), and target_laser_start().

◆ G_Spawn()

edict_t* G_Spawn ( void  )

Definition at line 420 of file g_utils.c.

421 {
422  int i;
423  edict_t *e;
424 
425  e = &g_edicts[(int)maxclients->value+1];
426  for ( i=maxclients->value+1 ; i<globals.num_edicts ; i++, e++)
427  {
428  // the first couple seconds of server time can involve a lot of
429  // freeing and allocating, so relax the replacement policy
430  if (!e->inuse && ( e->freetime < 2 || level.time - e->freetime > 0.5 ) )
431  {
432  G_InitEdict (e);
433  return e;
434  }
435  }
436 
437  if (i == game.maxentities)
438  gi.error ("ED_Alloc: no free edicts");
439 
441  G_InitEdict (e);
442  return e;
443 }

Referenced by ai_run(), Cmd_Give_f(), CreateTargetChangeLevel(), Drop_Item(), fire_bfg(), fire_blaster(), fire_grenade(), fire_grenade2(), fire_rocket(), G_UseTargets(), InitBodyQue(), jorg_dead(), makron_die(), MakronToss(), plat_spawn_inside_trigger(), PlayerNoise(), PlayerTrail_Init(), SP_CreateCoopSpots(), SP_misc_teleporter(), SpawnEntities(), Think_SpawnDoorTrigger(), ThrowDebris(), ThrowGib(), and use_target_spawner().

◆ G_TouchSolids()

void G_TouchSolids ( edict_t ent)

Definition at line 508 of file g_utils.c.

509 {
510  int i, num;
511  edict_t *touch[MAX_EDICTS], *hit;
512 
513  num = gi.BoxEdicts (ent->absmin, ent->absmax, touch
515 
516  // be careful, it is possible to have an entity in this
517  // list removed before we get to it (killtriggered)
518  for (i=0 ; i<num ; i++)
519  {
520  hit = touch[i];
521  if (!hit->inuse)
522  continue;
523  if (ent->touch)
524  ent->touch (hit, ent, NULL, NULL);
525  if (!ent->inuse)
526  break;
527  }
528 }

◆ G_TouchTriggers()

void G_TouchTriggers ( edict_t ent)

Definition at line 475 of file g_utils.c.

476 {
477  int i, num;
478  edict_t *touch[MAX_EDICTS], *hit;
479 
480  // dead things don't activate triggers!
481  if ((ent->client || (ent->svflags & SVF_MONSTER)) && (ent->health <= 0))
482  return;
483 
484  num = gi.BoxEdicts (ent->absmin, ent->absmax, touch
486 
487  // be careful, it is possible to have an entity in this
488  // list removed before we get to it (killtriggered)
489  for (i=0 ; i<num ; i++)
490  {
491  hit = touch[i];
492  if (!hit->inuse)
493  continue;
494  if (!hit->touch)
495  continue;
496  hit->touch (hit, ent, NULL, NULL);
497  }
498 }

Referenced by ClientThink(), SV_movestep(), SV_Physics_Step(), SV_Push(), SV_PushEntity(), and SV_StepDirection().

◆ G_UseTargets()

void G_UseTargets ( edict_t ent,
edict_t activator 
)

Definition at line 173 of file g_utils.c.

174 {
175  edict_t *t;
176 
177 //
178 // check for a delay
179 //
180  if (ent->delay)
181  {
182  // create a temp object to fire at a later time
183  t = G_Spawn();
184  t->classname = "DelayedUse";
185  t->nextthink = level.time + ent->delay;
186  t->think = Think_Delay;
187  t->activator = activator;
188  if (!activator)
189  gi.dprintf ("Think_Delay with no activator\n");
190  t->message = ent->message;
191  t->target = ent->target;
192  t->killtarget = ent->killtarget;
193  return;
194  }
195 
196 
197 //
198 // print the message
199 //
200  if ((ent->message) && !(activator->svflags & SVF_MONSTER))
201  {
202  gi.centerprintf (activator, "%s", ent->message);
203  if (ent->noise_index)
204  gi.sound (activator, CHAN_AUTO, ent->noise_index, 1, ATTN_NORM, 0);
205  else
206  gi.sound (activator, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
207  }
208 
209 //
210 // kill killtargets
211 //
212  if (ent->killtarget)
213  {
214  t = NULL;
215  while ((t = G_Find (t, FOFS(targetname), ent->killtarget)))
216  {
217  G_FreeEdict (t);
218  if (!ent->inuse)
219  {
220  gi.dprintf("entity was removed while using killtargets\n");
221  return;
222  }
223  }
224  }
225 
226 //
227 // fire targets
228 //
229  if (ent->target)
230  {
231  t = NULL;
232  while ((t = G_Find (t, FOFS(targetname), ent->target)))
233  {
234  // doors fire area portals in a specific way
235  if (!Q_stricmp(t->classname, "func_areaportal") &&
236  (!Q_stricmp(ent->classname, "func_door") || !Q_stricmp(ent->classname, "func_door_rotating")))
237  continue;
238 
239  if (t == ent)
240  {
241  gi.dprintf ("WARNING: Entity used itself.\n");
242  }
243  else
244  {
245  if (t->use)
246  t->use (t, ent, activator);
247  }
248  if (!ent->inuse)
249  {
250  gi.dprintf("entity was removed while using targets\n");
251  return;
252  }
253  }
254  }
255 }

Referenced by button_wait(), door_go_up(), func_clock_think(), func_explosive_explode(), func_timer_think(), misc_viper_bomb_touch(), monster_death_use(), multi_trigger(), path_corner_touch(), point_combat_touch(), SP_trigger_always(), target_actor_touch(), target_crosslevel_target_think(), target_explosion_explode(), Think_Delay(), Touch_Item(), train_wait(), trigger_key_use(), trigger_relay_use(), use_target_goal(), and use_target_secret().

◆ KillBox()

qboolean KillBox ( edict_t ent)

Definition at line 549 of file g_utils.c.

550 {
551  trace_t tr;
552 
553  while (1)
554  {
555  tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, ent->s.origin, NULL, MASK_PLAYERSOLID);
556  if (!tr.ent)
557  break;
558 
559  // nail it
560  T_Damage (tr.ent, ent, ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 0, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);
561 
562  // if we didn't kill it, fail
563  if (tr.ent->solid)
564  return false;
565  }
566 
567  return true; // all clear
568 }

Referenced by func_explosive_spawn(), func_object_use(), func_wall_use(), monster_triggered_spawn(), PutClientInServer(), teleporter_touch(), use_killbox(), and use_target_spawner().

◆ Think_Delay()

void Think_Delay ( edict_t ent)

Definition at line 151 of file g_utils.c.

152 {
153  G_UseTargets (ent, ent->activator);
154  G_FreeEdict (ent);
155 }

Referenced by G_UseTargets().

◆ tv()

float* tv ( float  x,
float  y,
float  z 
)

Definition at line 266 of file g_utils.c.

267 {
268  static int index;
269  static vec3_t vecs[8];
270  float *v;
271 
272  // use an array so that multiple tempvectors won't collide
273  // for a while
274  v = vecs[index];
275  index = (index + 1)&7;
276 
277  v[0] = x;
278  v[1] = y;
279  v[2] = z;
280 
281  return v;
282 }

Referenced by droptofloor().

◆ vectoangles()

void vectoangles ( vec3_t  value1,
vec3_t  angles 
)

Definition at line 356 of file g_utils.c.

357 {
358  float forward;
359  float yaw, pitch;
360 
361  if (value1[1] == 0 && value1[0] == 0)
362  {
363  yaw = 0;
364  if (value1[2] > 0)
365  pitch = 90;
366  else
367  pitch = 270;
368  }
369  else
370  {
371  if (value1[0])
372  yaw = (int) (atan2(value1[1], value1[0]) * 180 / M_PI);
373  else if (value1[1] > 0)
374  yaw = 90;
375  else
376  yaw = -90;
377  if (yaw < 0)
378  yaw += 360;
379 
380  forward = sqrt (value1[0]*value1[0] + value1[1]*value1[1]);
381  pitch = (int) (atan2(value1[2], forward) * 180 / M_PI);
382  if (pitch < 0)
383  pitch += 360;
384  }
385 
386  angles[PITCH] = -pitch;
387  angles[YAW] = yaw;
388  angles[ROLL] = 0;
389 }

Referenced by fire_bfg(), fire_blaster(), fire_grenade(), fire_grenade2(), fire_lead(), fire_rocket(), gib_touch(), MakronHyperblaster(), medic_cable_attack(), misc_viper_bomb_prethink(), parasite_drain_attack_ok(), soldier_fire(), TankMachineGun(), turret_driver_link(), and turret_driver_think().

◆ vectoyaw()

float vectoyaw ( vec3_t  vec)

Definition at line 333 of file g_utils.c.

334 {
335  float yaw;
336 
337  if (/*vec[YAW] == 0 &&*/ vec[PITCH] == 0)
338  {
339  yaw = 0;
340  if (vec[YAW] > 0)
341  yaw = 90;
342  else if (vec[YAW] < 0)
343  yaw = -90;
344  }
345  else
346  {
347  yaw = (int) (atan2(vec[YAW], vec[PITCH]) * 180 / M_PI);
348  if (yaw < 0)
349  yaw += 360;
350  }
351 
352  return yaw;
353 }

Referenced by actor_pain(), actor_use(), ai_charge(), ai_checkattack(), ai_run(), ai_stand(), barrel_touch(), Boss2_CheckAttack(), FindTarget(), HuntTarget(), Jorg_CheckAttack(), Makron_CheckAttack(), MakronSpawn(), monster_start_go(), path_corner_touch(), PlayerTrail_Add(), and target_actor_touch().

◆ vtos()

char* vtos ( vec3_t  v)

Definition at line 293 of file g_utils.c.

294 {
295  static int index;
296  static char str[8][32];
297  char *s;
298 
299  // use an array so that multiple vtos won't collide
300  s = str[index];
301  index = (index + 1)&7;
302 
303  Com_sprintf (s, 32, "(%i %i %i)", (int)v[0], (int)v[1], (int)v[2]);
304 
305  return s;
306 }

Referenced by actor_use(), droptofloor(), flymonster_start_go(), FoundTarget(), monster_start(), monster_start_go(), point_combat_touch(), SP_func_clock(), SP_func_door_rotating(), SP_func_timer(), SP_func_train(), SP_misc_actor(), SP_misc_strogg_ship(), SP_misc_viper(), SP_path_corner(), SP_target_actor(), SP_target_changelevel(), SP_target_earthquake(), SP_target_help(), SP_target_lightramp(), SP_target_speaker(), SP_trigger_gravity(), SP_trigger_key(), SP_trigger_once(), SP_turret_driver(), SpawnItem(), target_laser_start(), target_lightramp_use(), train_next(), turret_breach_finish_init(), and walkmonster_start_go().

Variable Documentation

◆ MOVEDIR_DOWN

vec3_t MOVEDIR_DOWN = {0, 0, -1}

Definition at line 312 of file g_utils.c.

Referenced by G_SetMovedir().

◆ MOVEDIR_UP

vec3_t MOVEDIR_UP = {0, 0, 1}

Definition at line 310 of file g_utils.c.

Referenced by G_SetMovedir().

◆ VEC_DOWN

vec3_t VEC_DOWN = {0, -2, 0}

Definition at line 311 of file g_utils.c.

Referenced by G_SetMovedir().

◆ VEC_UP

vec3_t VEC_UP = {0, -1, 0}

Definition at line 309 of file g_utils.c.

Referenced by G_SetMovedir().

gi
game_import_t gi
Definition: g_main.c:25
game_import_t::dprintf
void(* dprintf)(char *fmt,...)
Definition: game.h:106
edict_s::s
entity_state_t s
Definition: g_local.h:970
YAW
#define YAW
Definition: q_shared.h:73
game_import_t::trace
trace_t(* trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passent, int contentmask)
Definition: game.h:128
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:45
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
edict_s::activator
edict_t * activator
Definition: g_local.h:1078
edict_s::absmax
vec3_t absmax
Definition: g_local.h:991
Think_Delay
void Think_Delay(edict_t *ent)
Definition: g_utils.c:151
maxclients
cvar_t * maxclients
Definition: g_main.c:44
BODY_QUEUE_SIZE
#define BODY_QUEUE_SIZE
Definition: g_local.h:84
v
GLdouble v
Definition: qgl_win.c:143
MOVEDIR_UP
vec3_t MOVEDIR_UP
Definition: g_utils.c:310
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1149
x
GLint GLenum GLint x
Definition: qgl_win.c:116
edict_s::inuse
qboolean inuse
Definition: g_local.h:976
trace_t
Definition: q_shared.h:453
z
GLdouble GLdouble z
Definition: qgl_win.c:283
VectorClear
#define VectorClear(a)
Definition: q_shared.h:166
i
int i
Definition: q_shared.c:305
MOD_TELEFRAG
#define MOD_TELEFRAG
Definition: g_local.h:490
edict_s::client
struct gclient_s * client
Definition: g_local.h:971
game_import_t::sound
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
Definition: game.h:109
PITCH
#define PITCH
Definition: q_shared.h:72
FOFS
#define FOFS(x)
Definition: g_local.h:510
TAG_LEVEL
#define TAG_LEVEL
Definition: g_local.h:79
edict_s::mins
vec3_t mins
Definition: g_local.h:990
M_PI
#define M_PI
Definition: q_shared.h:142
g_edicts
edict_t * g_edicts
Definition: g_main.c:33
ATTN_NORM
#define ATTN_NORM
Definition: q_shared.h:995
T_Damage
void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
Definition: g_combat.c:377
G_UseTargets
void G_UseTargets(edict_t *ent, edict_t *activator)
Definition: g_utils.c:173
j
GLint j
Definition: qgl_win.c:150
edict_s::message
char * message
Definition: g_local.h:1010
CHAN_AUTO
#define CHAN_AUTO
Definition: q_shared.h:983
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
edict_s::svflags
int svflags
Definition: g_local.h:989
DAMAGE_NO_PROTECTION
#define DAMAGE_NO_PROTECTION
Definition: g_local.h:668
edict_s::classname
char * classname
Definition: g_local.h:1011
edict_s
Definition: g_local.h:968
VEC_DOWN
vec3_t VEC_DOWN
Definition: g_utils.c:311
ROLL
#define ROLL
Definition: q_shared.h:74
game_import_t::soundindex
int(* soundindex)(char *name)
Definition: game.h:122
forward
static vec3_t forward
Definition: p_view.c:29
VectorLength
vec_t VectorLength(vec3_t v)
Definition: q_shared.c:762
MOVEDIR_DOWN
vec3_t MOVEDIR_DOWN
Definition: g_utils.c:312
t
GLdouble t
Definition: qgl_win.c:328
AREA_TRIGGERS
#define AREA_TRIGGERS
Definition: q_shared.h:408
cvar_s::value
float value
Definition: q_shared.h:331
game
game_locals_t game
Definition: g_main.c:23
G_InitEdict
void G_InitEdict(edict_t *e)
Definition: g_utils.c:401
edict_s::noise_index
int noise_index
Definition: g_local.h:1087
entity_state_s::number
int number
Definition: q_shared.h:1147
NULL
#define NULL
Definition: q_shared.h:67
globals
game_export_t globals
Definition: g_main.c:26
edict_s::solid
solid_t solid
Definition: g_local.h:992
G_FreeEdict
void G_FreeEdict(edict_t *ed)
Definition: g_utils.c:452
game_import_t::TagMalloc
void *(* TagMalloc)(int size, int tag)
Definition: game.h:157
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1180
game_import_t::centerprintf
void(* centerprintf)(edict_t *ent, char *fmt,...)
Definition: game.h:108
SOLID_NOT
@ SOLID_NOT
Definition: game.h:35
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:87
game_import_t::unlinkentity
void(* unlinkentity)(edict_t *ent)
Definition: game.h:139
s
static fixed16_t s
Definition: r_scan.c:30
y
GLint y
Definition: qgl_win.c:115
game_import_t::error
void(* error)(char *fmt,...)
Definition: game.h:118
VEC_UP
vec3_t VEC_UP
Definition: g_utils.c:309
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:420
AREA_SOLID
#define AREA_SOLID
Definition: q_shared.h:407
level
GLint level
Definition: qgl_win.c:116
MAXCHOICES
#define MAXCHOICES
Definition: g_utils.c:116
sqrt
double sqrt(double x)
edict_s::maxs
vec3_t maxs
Definition: g_local.h:990
edict_s::gravity
float gravity
Definition: g_local.h:1034
trace_t::ent
struct edict_s * ent
Definition: q_shared.h:462
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:1046
right
GLdouble right
Definition: qgl_win.c:159
edict_s::killtarget
char * killtarget
Definition: g_local.h:1019
edict_s::delay
float delay
Definition: g_local.h:1094
VectorCompare
int VectorCompare(vec3_t v1, vec3_t v2)
Definition: q_shared.c:672
game_locals_t::maxentities
int maxentities
Definition: g_local.h:287
MASK_PLAYERSOLID
#define MASK_PLAYERSOLID
Definition: q_shared.h:396
game_import_t::BoxEdicts
int(* BoxEdicts)(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype)
Definition: game.h:140
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
edict_s::absmin
vec3_t absmin
Definition: g_local.h:991
edict_s::target
char * target
Definition: g_local.h:1017
game_export_t::num_edicts
int num_edicts
Definition: game.h:231
edict_s::freetime
float freetime
Definition: g_local.h:1005
edict_s::health
int health
Definition: g_local.h:1057