Quake II RTX doxygen  1.0 dev
g_local.h File Reference
#include "shared/shared.h"
#include "shared/list.h"
#include "shared/game.h"

Go to the source code of this file.

Classes

struct  gitem_armor_t
 
struct  gitem_s
 
struct  game_locals_t
 
struct  level_locals_t
 
struct  spawn_temp_t
 
struct  moveinfo_t
 
struct  mframe_t
 
struct  mmove_t
 
struct  monsterinfo_t
 
struct  client_persistant_t
 
struct  client_respawn_t
 
struct  gclient_s
 
struct  edict_s
 

Macros

#define GAME_INCLUDE
 
#define G_FEATURES   (GMF_PROPERINUSE|GMF_WANT_ALL_DISCONNECTS|GMF_ENHANCED_SAVEGAMES)
 
#define GAMEVERSION   "baseq2"
 
#define svc_muzzleflash   1
 
#define svc_muzzleflash2   2
 
#define svc_temp_entity   3
 
#define svc_layout   4
 
#define svc_inventory   5
 
#define svc_stufftext   11
 
#define DAMAGE_TIME   0.5
 
#define FALL_TIME   0.3
 
#define SPAWNFLAG_NOT_EASY   0x00000100
 
#define SPAWNFLAG_NOT_MEDIUM   0x00000200
 
#define SPAWNFLAG_NOT_HARD   0x00000400
 
#define SPAWNFLAG_NOT_DEATHMATCH   0x00000800
 
#define SPAWNFLAG_NOT_COOP   0x00001000
 
#define FL_FLY   0x00000001
 
#define FL_SWIM   0x00000002
 
#define FL_IMMUNE_LASER   0x00000004
 
#define FL_INWATER   0x00000008
 
#define FL_GODMODE   0x00000010
 
#define FL_NOTARGET   0x00000020
 
#define FL_IMMUNE_SLIME   0x00000040
 
#define FL_IMMUNE_LAVA   0x00000080
 
#define FL_PARTIALGROUND   0x00000100
 
#define FL_WATERJUMP   0x00000200
 
#define FL_TEAMSLAVE   0x00000400
 
#define FL_NO_KNOCKBACK   0x00000800
 
#define FL_POWER_ARMOR   0x00001000
 
#define FL_RESPAWN   0x80000000
 
#define FRAMETIME   0.1
 
#define TAG_GAME   765
 
#define TAG_LEVEL   766
 
#define MELEE_DISTANCE   80
 
#define BODY_QUEUE_SIZE   8
 
#define DEAD_NO   0
 
#define DEAD_DYING   1
 
#define DEAD_DEAD   2
 
#define DEAD_RESPAWNABLE   3
 
#define RANGE_MELEE   0
 
#define RANGE_NEAR   1
 
#define RANGE_MID   2
 
#define RANGE_FAR   3
 
#define GIB_ORGANIC   0
 
#define GIB_METALLIC   1
 
#define AI_STAND_GROUND   0x00000001
 
#define AI_TEMP_STAND_GROUND   0x00000002
 
#define AI_SOUND_TARGET   0x00000004
 
#define AI_LOST_SIGHT   0x00000008
 
#define AI_PURSUIT_LAST_SEEN   0x00000010
 
#define AI_PURSUE_NEXT   0x00000020
 
#define AI_PURSUE_TEMP   0x00000040
 
#define AI_HOLD_FRAME   0x00000080
 
#define AI_GOOD_GUY   0x00000100
 
#define AI_BRUTAL   0x00000200
 
#define AI_NOSTEP   0x00000400
 
#define AI_DUCKED   0x00000800
 
#define AI_COMBAT_POINT   0x00001000
 
#define AI_MEDIC   0x00002000
 
#define AI_RESURRECTING   0x00004000
 
#define AS_STRAIGHT   1
 
#define AS_SLIDING   2
 
#define AS_MELEE   3
 
#define AS_MISSILE   4
 
#define ARMOR_NONE   0
 
#define ARMOR_JACKET   1
 
#define ARMOR_COMBAT   2
 
#define ARMOR_BODY   3
 
#define ARMOR_SHARD   4
 
#define POWER_ARMOR_NONE   0
 
#define POWER_ARMOR_SCREEN   1
 
#define POWER_ARMOR_SHIELD   2
 
#define RIGHT_HANDED   0
 
#define LEFT_HANDED   1
 
#define CENTER_HANDED   2
 
#define SFL_CROSS_TRIGGER_1   0x00000001
 
#define SFL_CROSS_TRIGGER_2   0x00000002
 
#define SFL_CROSS_TRIGGER_3   0x00000004
 
#define SFL_CROSS_TRIGGER_4   0x00000008
 
#define SFL_CROSS_TRIGGER_5   0x00000010
 
#define SFL_CROSS_TRIGGER_6   0x00000020
 
#define SFL_CROSS_TRIGGER_7   0x00000040
 
#define SFL_CROSS_TRIGGER_8   0x00000080
 
#define SFL_CROSS_TRIGGER_MASK   0x000000ff
 
#define PNOISE_SELF   0
 
#define PNOISE_WEAPON   1
 
#define PNOISE_IMPACT   2
 
#define IT_WEAPON   1
 
#define IT_AMMO   2
 
#define IT_ARMOR   4
 
#define IT_STAY_COOP   8
 
#define IT_KEY   16
 
#define IT_POWERUP   32
 
#define WEAP_BLASTER   1
 
#define WEAP_SHOTGUN   2
 
#define WEAP_SUPERSHOTGUN   3
 
#define WEAP_MACHINEGUN   4
 
#define WEAP_CHAINGUN   5
 
#define WEAP_GRENADES   6
 
#define WEAP_GRENADELAUNCHER   7
 
#define WEAP_ROCKETLAUNCHER   8
 
#define WEAP_HYPERBLASTER   9
 
#define WEAP_RAILGUN   10
 
#define WEAP_BFG   11
 
#define WEAP_FLAREGUN   12
 
#define MOD_UNKNOWN   0
 
#define MOD_BLASTER   1
 
#define MOD_SHOTGUN   2
 
#define MOD_SSHOTGUN   3
 
#define MOD_MACHINEGUN   4
 
#define MOD_CHAINGUN   5
 
#define MOD_GRENADE   6
 
#define MOD_G_SPLASH   7
 
#define MOD_ROCKET   8
 
#define MOD_R_SPLASH   9
 
#define MOD_HYPERBLASTER   10
 
#define MOD_RAILGUN   11
 
#define MOD_BFG_LASER   12
 
#define MOD_BFG_BLAST   13
 
#define MOD_BFG_EFFECT   14
 
#define MOD_HANDGRENADE   15
 
#define MOD_HG_SPLASH   16
 
#define MOD_WATER   17
 
#define MOD_SLIME   18
 
#define MOD_LAVA   19
 
#define MOD_CRUSH   20
 
#define MOD_TELEFRAG   21
 
#define MOD_FALLING   22
 
#define MOD_SUICIDE   23
 
#define MOD_HELD_GRENADE   24
 
#define MOD_EXPLOSIVE   25
 
#define MOD_BARREL   26
 
#define MOD_BOMB   27
 
#define MOD_EXIT   28
 
#define MOD_SPLASH   29
 
#define MOD_TARGET_LASER   30
 
#define MOD_TRIGGER_HURT   31
 
#define MOD_HIT   32
 
#define MOD_TARGET_BLASTER   33
 
#define MOD_FRIENDLY_FIRE   0x8000000
 
#define FOFS(x)   q_offsetof(edict_t, x)
 
#define STOFS(x)   q_offsetof(spawn_temp_t, x)
 
#define LLOFS(x)   q_offsetof(level_locals_t, x)
 
#define GLOFS(x)   q_offsetof(game_locals_t, x)
 
#define CLOFS(x)   q_offsetof(gclient_t, x)
 
#define random()   ((rand () & 0x7fff) / ((float)0x7fff))
 
#define crandom()   (2.0 * (random() - 0.5))
 
#define world   (&g_edicts[0])
 
#define ITEM_TRIGGER_SPAWN   0x00000001
 
#define ITEM_NO_TOUCH   0x00000002
 
#define DROPPED_ITEM   0x00010000
 
#define DROPPED_PLAYER_ITEM   0x00020000
 
#define ITEM_TARGETS_USED   0x00040000
 
#define ITEM_INDEX(x)   ((x)-itemlist)
 
#define DAMAGE_RADIUS   0x00000001
 
#define DAMAGE_NO_ARMOR   0x00000002
 
#define DAMAGE_ENERGY   0x00000004
 
#define DAMAGE_NO_KNOCKBACK   0x00000008
 
#define DAMAGE_BULLET   0x00000010
 
#define DAMAGE_NO_PROTECTION   0x00000020
 
#define DEFAULT_BULLET_HSPREAD   300
 
#define DEFAULT_BULLET_VSPREAD   500
 
#define DEFAULT_SHOTGUN_HSPREAD   1000
 
#define DEFAULT_SHOTGUN_VSPREAD   500
 
#define DEFAULT_DEATHMATCH_SHOTGUN_COUNT   12
 
#define DEFAULT_SHOTGUN_COUNT   12
 
#define DEFAULT_SSHOTGUN_COUNT   20
 
#define CLOCK_MESSAGE_SIZE   16
 
#define ANIM_BASIC   0
 
#define ANIM_WAVE   1
 
#define ANIM_JUMP   2
 
#define ANIM_PAIN   3
 
#define ANIM_ATTACK   4
 
#define ANIM_DEATH   5
 
#define ANIM_REVERSE   6
 

Typedefs

typedef struct gitem_s gitem_t
 

Enumerations

enum  damage_t { DAMAGE_NO, DAMAGE_YES, DAMAGE_AIM }
 
enum  weaponstate_t { WEAPON_READY, WEAPON_ACTIVATING, WEAPON_DROPPING, WEAPON_FIRING }
 
enum  ammo_t {
  AMMO_BULLETS, AMMO_SHELLS, AMMO_ROCKETS, AMMO_GRENADES,
  AMMO_CELLS, AMMO_SLUGS
}
 
enum  movetype_t {
  MOVETYPE_NONE, MOVETYPE_NOCLIP, MOVETYPE_PUSH, MOVETYPE_STOP,
  MOVETYPE_WALK, MOVETYPE_STEP, MOVETYPE_FLY, MOVETYPE_TOSS,
  MOVETYPE_FLYMISSILE, MOVETYPE_BOUNCE
}
 
enum  fieldtype_t {
  F_BAD, F_BYTE, F_SHORT, F_INT,
  F_FLOAT, F_LSTRING, F_GSTRING, F_ZSTRING,
  F_VECTOR, F_ANGLEHACK, F_EDICT, F_ITEM,
  F_CLIENT, F_FUNCTION, F_POINTER, F_IGNORE
}
 

Functions

void Cmd_Help_f (edict_t *ent)
 
void Cmd_Score_f (edict_t *ent)
 
void PrecacheItem (gitem_t *it)
 
void InitItems (void)
 
void SetItemNames (void)
 
gitem_tFindItem (char *pickup_name)
 
gitem_tFindItemByClassname (char *classname)
 
edict_t * Drop_Item (edict_t *ent, gitem_t *item)
 
void SetRespawn (edict_t *ent, float delay)
 
void ChangeWeapon (edict_t *ent)
 
void SpawnItem (edict_t *ent, gitem_t *item)
 
void Think_Weapon (edict_t *ent)
 
int ArmorIndex (edict_t *ent)
 
int PowerArmorType (edict_t *ent)
 
gitem_tGetItemByIndex (int index)
 
qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
 
void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
 
qboolean KillBox (edict_t *ent)
 
void G_ProjectSource (const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result)
 
edict_t * G_Find (edict_t *from, int fieldofs, char *match)
 
edict_t * findradius (edict_t *from, vec3_t org, float rad)
 
edict_t * G_PickTarget (char *targetname)
 
void G_UseTargets (edict_t *ent, edict_t *activator)
 
void G_SetMovedir (vec3_t angles, vec3_t movedir)
 
void G_InitEdict (edict_t *e)
 
edict_t * G_Spawn (void)
 
void G_FreeEdict (edict_t *e)
 
void G_TouchTriggers (edict_t *ent)
 
void G_TouchSolids (edict_t *ent)
 
char * G_CopyString (char *in)
 
float * tv (float x, float y, float z)
 
char * vtos (vec3_t v)
 
float vectoyaw (vec3_t vec)
 
void vectoangles (vec3_t vec, vec3_t angles)
 
qboolean OnSameTeam (edict_t *ent1, edict_t *ent2)
 
qboolean CanDamage (edict_t *targ, edict_t *inflictor)
 
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)
 
void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod)
 
void monster_fire_bullet (edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
 
void monster_fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int flashtype)
 
void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
 
void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
 
void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
 
void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
 
void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
 
void M_droptofloor (edict_t *ent)
 
void monster_think (edict_t *self)
 
void walkmonster_start (edict_t *self)
 
void swimmonster_start (edict_t *self)
 
void flymonster_start (edict_t *self)
 
void AttackFinished (edict_t *self, float time)
 
void monster_death_use (edict_t *self)
 
void M_CatagorizePosition (edict_t *ent)
 
qboolean M_CheckAttack (edict_t *self)
 
void M_FlyCheck (edict_t *self)
 
void M_CheckGround (edict_t *ent)
 
void ThrowHead (edict_t *self, char *gibname, int damage, int type)
 
void ThrowClientHead (edict_t *self, int damage)
 
void ThrowGib (edict_t *self, char *gibname, int damage, int type)
 
void BecomeExplosion1 (edict_t *self)
 
void func_clock_think (edict_t *self)
 
void func_clock_use (edict_t *self, edict_t *other, edict_t *activator)
 
void AI_SetSightClient (void)
 
void ai_stand (edict_t *self, float dist)
 
void ai_move (edict_t *self, float dist)
 
void ai_walk (edict_t *self, float dist)
 
void ai_turn (edict_t *self, float dist)
 
void ai_run (edict_t *self, float dist)
 
void ai_charge (edict_t *self, float dist)
 
int range (edict_t *self, edict_t *other)
 
void FoundTarget (edict_t *self)
 
qboolean infront (edict_t *self, edict_t *other)
 
qboolean visible (edict_t *self, edict_t *other)
 
qboolean FacingIdeal (edict_t *self)
 
void ThrowDebris (edict_t *self, char *modelname, float speed, vec3_t origin)
 
qboolean fire_hit (edict_t *self, vec3_t aim, int damage, int kick)
 
void fire_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
 
void fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
 
void fire_blaster (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
 
void fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
 
void fire_grenade2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held)
 
void fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
 
void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
 
void fire_bfg (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
 
void PlayerTrail_Init (void)
 
void PlayerTrail_Add (vec3_t spot)
 
void PlayerTrail_New (vec3_t spot)
 
edict_t * PlayerTrail_PickFirst (edict_t *self)
 
edict_t * PlayerTrail_PickNext (edict_t *self)
 
edict_t * PlayerTrail_LastSpot (void)
 
void respawn (edict_t *ent)
 
void BeginIntermission (edict_t *targ)
 
void PutClientInServer (edict_t *ent)
 
void InitClientPersistant (gclient_t *client)
 
void InitClientResp (gclient_t *client)
 
void InitBodyQue (void)
 
void ClientBeginServerFrame (edict_t *ent)
 
void player_pain (edict_t *self, edict_t *other, float kick, int damage)
 
void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
 
void ServerCommand (void)
 
qboolean SV_FilterPacket (char *from)
 
void ClientEndServerFrame (edict_t *ent)
 
void MoveClientToIntermission (edict_t *client)
 
void G_SetStats (edict_t *ent)
 
void G_SetSpectatorStats (edict_t *ent)
 
void G_CheckChaseStats (edict_t *ent)
 
void ValidateSelectedItem (edict_t *ent)
 
void DeathmatchScoreboardMessage (edict_t *client, edict_t *killer)
 
void PlayerNoise (edict_t *who, vec3_t where, int type)
 
qboolean M_CheckBottom (edict_t *ent)
 
qboolean M_walkmove (edict_t *ent, float yaw, float dist)
 
void M_MoveToGoal (edict_t *ent, float dist)
 
void M_ChangeYaw (edict_t *ent)
 
void G_RunEntity (edict_t *ent)
 
void SaveClientData (void)
 
void FetchClientEntData (edict_t *ent)
 
void UpdateChaseCam (edict_t *ent)
 
void ChaseNext (edict_t *ent)
 
void ChasePrev (edict_t *ent)
 
void GetChaseTarget (edict_t *ent)
 

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_t * g_edicts
 
cvar_t * maxentities
 
cvar_t * deathmatch
 
cvar_t * coop
 
cvar_t * dmflags
 
cvar_t * skill
 
cvar_t * fraglimit
 
cvar_t * timelimit
 
cvar_t * password
 
cvar_t * spectator_password
 
cvar_t * needpass
 
cvar_t * g_select_empty
 
cvar_t * dedicated
 
cvar_t * nomonsters
 
cvar_t * filterban
 
cvar_t * sv_gravity
 
cvar_t * sv_maxvelocity
 
cvar_t * gun_x
 
cvar_t * gun_y
 
cvar_t * gun_z
 
cvar_t * sv_rollspeed
 
cvar_t * sv_rollangle
 
cvar_t * run_pitch
 
cvar_t * run_roll
 
cvar_t * bob_up
 
cvar_t * bob_pitch
 
cvar_t * bob_roll
 
cvar_t * sv_cheats
 
cvar_t * maxclients
 
cvar_t * maxspectators
 
cvar_t * flood_msgs
 
cvar_t * flood_persecond
 
cvar_t * flood_waitdelay
 
cvar_t * sv_maplist
 
cvar_t * sv_features
 
cvar_t * sv_flaregun
 
gitem_t itemlist []
 

Macro Definition Documentation

◆ AI_BRUTAL

#define AI_BRUTAL   0x00000200

Definition at line 135 of file g_local.h.

◆ AI_COMBAT_POINT

#define AI_COMBAT_POINT   0x00001000

Definition at line 138 of file g_local.h.

◆ AI_DUCKED

#define AI_DUCKED   0x00000800

Definition at line 137 of file g_local.h.

◆ AI_GOOD_GUY

#define AI_GOOD_GUY   0x00000100

Definition at line 134 of file g_local.h.

◆ AI_HOLD_FRAME

#define AI_HOLD_FRAME   0x00000080

Definition at line 133 of file g_local.h.

◆ AI_LOST_SIGHT

#define AI_LOST_SIGHT   0x00000008

Definition at line 129 of file g_local.h.

◆ AI_MEDIC

#define AI_MEDIC   0x00002000

Definition at line 139 of file g_local.h.

◆ AI_NOSTEP

#define AI_NOSTEP   0x00000400

Definition at line 136 of file g_local.h.

◆ AI_PURSUE_NEXT

#define AI_PURSUE_NEXT   0x00000020

Definition at line 131 of file g_local.h.

◆ AI_PURSUE_TEMP

#define AI_PURSUE_TEMP   0x00000040

Definition at line 132 of file g_local.h.

◆ AI_PURSUIT_LAST_SEEN

#define AI_PURSUIT_LAST_SEEN   0x00000010

Definition at line 130 of file g_local.h.

◆ AI_RESURRECTING

#define AI_RESURRECTING   0x00004000

Definition at line 140 of file g_local.h.

◆ AI_SOUND_TARGET

#define AI_SOUND_TARGET   0x00000004

Definition at line 128 of file g_local.h.

◆ AI_STAND_GROUND

#define AI_STAND_GROUND   0x00000001

Definition at line 126 of file g_local.h.

◆ AI_TEMP_STAND_GROUND

#define AI_TEMP_STAND_GROUND   0x00000002

Definition at line 127 of file g_local.h.

◆ ANIM_ATTACK

#define ANIM_ATTACK   4

Definition at line 815 of file g_local.h.

◆ ANIM_BASIC

#define ANIM_BASIC   0

Definition at line 811 of file g_local.h.

◆ ANIM_DEATH

#define ANIM_DEATH   5

Definition at line 816 of file g_local.h.

◆ ANIM_JUMP

#define ANIM_JUMP   2

Definition at line 813 of file g_local.h.

◆ ANIM_PAIN

#define ANIM_PAIN   3

Definition at line 814 of file g_local.h.

◆ ANIM_REVERSE

#define ANIM_REVERSE   6

Definition at line 817 of file g_local.h.

◆ ANIM_WAVE

#define ANIM_WAVE   1

Definition at line 812 of file g_local.h.

◆ ARMOR_BODY

#define ARMOR_BODY   3

Definition at line 152 of file g_local.h.

◆ ARMOR_COMBAT

#define ARMOR_COMBAT   2

Definition at line 151 of file g_local.h.

◆ ARMOR_JACKET

#define ARMOR_JACKET   1

Definition at line 150 of file g_local.h.

◆ ARMOR_NONE

#define ARMOR_NONE   0

Definition at line 149 of file g_local.h.

◆ ARMOR_SHARD

#define ARMOR_SHARD   4

Definition at line 153 of file g_local.h.

◆ AS_MELEE

#define AS_MELEE   3

Definition at line 145 of file g_local.h.

◆ AS_MISSILE

#define AS_MISSILE   4

Definition at line 146 of file g_local.h.

◆ AS_SLIDING

#define AS_SLIDING   2

Definition at line 144 of file g_local.h.

◆ AS_STRAIGHT

#define AS_STRAIGHT   1

Definition at line 143 of file g_local.h.

◆ BODY_QUEUE_SIZE

#define BODY_QUEUE_SIZE   8

Definition at line 84 of file g_local.h.

◆ CENTER_HANDED

#define CENTER_HANDED   2

Definition at line 163 of file g_local.h.

◆ CLOCK_MESSAGE_SIZE

#define CLOCK_MESSAGE_SIZE   16

Definition at line 692 of file g_local.h.

◆ CLOFS

#define CLOFS (   x)    q_offsetof(gclient_t, x)

Definition at line 502 of file g_local.h.

◆ crandom

#define crandom ( )    (2.0 * (random() - 0.5))

Definition at line 505 of file g_local.h.

◆ DAMAGE_BULLET

#define DAMAGE_BULLET   0x00000010

Definition at line 651 of file g_local.h.

◆ DAMAGE_ENERGY

#define DAMAGE_ENERGY   0x00000004

Definition at line 649 of file g_local.h.

◆ DAMAGE_NO_ARMOR

#define DAMAGE_NO_ARMOR   0x00000002

Definition at line 648 of file g_local.h.

◆ DAMAGE_NO_KNOCKBACK

#define DAMAGE_NO_KNOCKBACK   0x00000008

Definition at line 650 of file g_local.h.

◆ DAMAGE_NO_PROTECTION

#define DAMAGE_NO_PROTECTION   0x00000020

Definition at line 652 of file g_local.h.

◆ DAMAGE_RADIUS

#define DAMAGE_RADIUS   0x00000001

Definition at line 647 of file g_local.h.

◆ DAMAGE_TIME

#define DAMAGE_TIME   0.5

Definition at line 46 of file g_local.h.

◆ DEAD_DEAD

#define DEAD_DEAD   2

Definition at line 112 of file g_local.h.

◆ DEAD_DYING

#define DEAD_DYING   1

Definition at line 111 of file g_local.h.

◆ DEAD_NO

#define DEAD_NO   0

Definition at line 110 of file g_local.h.

◆ DEAD_RESPAWNABLE

#define DEAD_RESPAWNABLE   3

Definition at line 113 of file g_local.h.

◆ DEFAULT_BULLET_HSPREAD

#define DEFAULT_BULLET_HSPREAD   300

Definition at line 654 of file g_local.h.

◆ DEFAULT_BULLET_VSPREAD

#define DEFAULT_BULLET_VSPREAD   500

Definition at line 655 of file g_local.h.

◆ DEFAULT_DEATHMATCH_SHOTGUN_COUNT

#define DEFAULT_DEATHMATCH_SHOTGUN_COUNT   12

Definition at line 658 of file g_local.h.

◆ DEFAULT_SHOTGUN_COUNT

#define DEFAULT_SHOTGUN_COUNT   12

Definition at line 659 of file g_local.h.

◆ DEFAULT_SHOTGUN_HSPREAD

#define DEFAULT_SHOTGUN_HSPREAD   1000

Definition at line 656 of file g_local.h.

◆ DEFAULT_SHOTGUN_VSPREAD

#define DEFAULT_SHOTGUN_VSPREAD   500

Definition at line 657 of file g_local.h.

◆ DEFAULT_SSHOTGUN_COUNT

#define DEFAULT_SSHOTGUN_COUNT   20

Definition at line 660 of file g_local.h.

◆ DROPPED_ITEM

#define DROPPED_ITEM   0x00010000

Definition at line 557 of file g_local.h.

◆ DROPPED_PLAYER_ITEM

#define DROPPED_PLAYER_ITEM   0x00020000

Definition at line 558 of file g_local.h.

◆ FALL_TIME

#define FALL_TIME   0.3

Definition at line 47 of file g_local.h.

◆ FL_FLY

#define FL_FLY   0x00000001

Definition at line 59 of file g_local.h.

◆ FL_GODMODE

#define FL_GODMODE   0x00000010

Definition at line 63 of file g_local.h.

◆ FL_IMMUNE_LASER

#define FL_IMMUNE_LASER   0x00000004

Definition at line 61 of file g_local.h.

◆ FL_IMMUNE_LAVA

#define FL_IMMUNE_LAVA   0x00000080

Definition at line 66 of file g_local.h.

◆ FL_IMMUNE_SLIME

#define FL_IMMUNE_SLIME   0x00000040

Definition at line 65 of file g_local.h.

◆ FL_INWATER

#define FL_INWATER   0x00000008

Definition at line 62 of file g_local.h.

◆ FL_NO_KNOCKBACK

#define FL_NO_KNOCKBACK   0x00000800

Definition at line 70 of file g_local.h.

◆ FL_NOTARGET

#define FL_NOTARGET   0x00000020

Definition at line 64 of file g_local.h.

◆ FL_PARTIALGROUND

#define FL_PARTIALGROUND   0x00000100

Definition at line 67 of file g_local.h.

◆ FL_POWER_ARMOR

#define FL_POWER_ARMOR   0x00001000

Definition at line 71 of file g_local.h.

◆ FL_RESPAWN

#define FL_RESPAWN   0x80000000

Definition at line 72 of file g_local.h.

◆ FL_SWIM

#define FL_SWIM   0x00000002

Definition at line 60 of file g_local.h.

◆ FL_TEAMSLAVE

#define FL_TEAMSLAVE   0x00000400

Definition at line 69 of file g_local.h.

◆ FL_WATERJUMP

#define FL_WATERJUMP   0x00000200

Definition at line 68 of file g_local.h.

◆ FOFS

#define FOFS (   x)    q_offsetof(edict_t, x)

Definition at line 498 of file g_local.h.

◆ FRAMETIME

#define FRAMETIME   0.1

Definition at line 75 of file g_local.h.

◆ G_FEATURES

#define G_FEATURES   (GMF_PROPERINUSE|GMF_WANT_ALL_DISCONNECTS|GMF_ENHANCED_SAVEGAMES)

Definition at line 30 of file g_local.h.

◆ GAME_INCLUDE

#define GAME_INCLUDE

Definition at line 26 of file g_local.h.

◆ GAMEVERSION

#define GAMEVERSION   "baseq2"

Definition at line 33 of file g_local.h.

◆ GIB_METALLIC

#define GIB_METALLIC   1

Definition at line 123 of file g_local.h.

◆ GIB_ORGANIC

#define GIB_ORGANIC   0

Definition at line 122 of file g_local.h.

◆ GLOFS

#define GLOFS (   x)    q_offsetof(game_locals_t, x)

Definition at line 501 of file g_local.h.

◆ IT_AMMO

#define IT_AMMO   2

Definition at line 212 of file g_local.h.

◆ IT_ARMOR

#define IT_ARMOR   4

Definition at line 213 of file g_local.h.

◆ IT_KEY

#define IT_KEY   16

Definition at line 215 of file g_local.h.

◆ IT_POWERUP

#define IT_POWERUP   32

Definition at line 216 of file g_local.h.

◆ IT_STAY_COOP

#define IT_STAY_COOP   8

Definition at line 214 of file g_local.h.

◆ IT_WEAPON

#define IT_WEAPON   1

Definition at line 211 of file g_local.h.

◆ ITEM_INDEX

#define ITEM_INDEX (   x)    ((x)-itemlist)

Definition at line 600 of file g_local.h.

◆ ITEM_NO_TOUCH

#define ITEM_NO_TOUCH   0x00000002

Definition at line 554 of file g_local.h.

◆ ITEM_TARGETS_USED

#define ITEM_TARGETS_USED   0x00040000

Definition at line 559 of file g_local.h.

◆ ITEM_TRIGGER_SPAWN

#define ITEM_TRIGGER_SPAWN   0x00000001

Definition at line 553 of file g_local.h.

◆ LEFT_HANDED

#define LEFT_HANDED   1

Definition at line 162 of file g_local.h.

◆ LLOFS

#define LLOFS (   x)    q_offsetof(level_locals_t, x)

Definition at line 500 of file g_local.h.

◆ MELEE_DISTANCE

#define MELEE_DISTANCE   80

Definition at line 82 of file g_local.h.

◆ MOD_BARREL

#define MOD_BARREL   26

Definition at line 483 of file g_local.h.

◆ MOD_BFG_BLAST

#define MOD_BFG_BLAST   13

Definition at line 470 of file g_local.h.

◆ MOD_BFG_EFFECT

#define MOD_BFG_EFFECT   14

Definition at line 471 of file g_local.h.

◆ MOD_BFG_LASER

#define MOD_BFG_LASER   12

Definition at line 469 of file g_local.h.

◆ MOD_BLASTER

#define MOD_BLASTER   1

Definition at line 458 of file g_local.h.

◆ MOD_BOMB

#define MOD_BOMB   27

Definition at line 484 of file g_local.h.

◆ MOD_CHAINGUN

#define MOD_CHAINGUN   5

Definition at line 462 of file g_local.h.

◆ MOD_CRUSH

#define MOD_CRUSH   20

Definition at line 477 of file g_local.h.

◆ MOD_EXIT

#define MOD_EXIT   28

Definition at line 485 of file g_local.h.

◆ MOD_EXPLOSIVE

#define MOD_EXPLOSIVE   25

Definition at line 482 of file g_local.h.

◆ MOD_FALLING

#define MOD_FALLING   22

Definition at line 479 of file g_local.h.

◆ MOD_FRIENDLY_FIRE

#define MOD_FRIENDLY_FIRE   0x8000000

Definition at line 491 of file g_local.h.

◆ MOD_G_SPLASH

#define MOD_G_SPLASH   7

Definition at line 464 of file g_local.h.

◆ MOD_GRENADE

#define MOD_GRENADE   6

Definition at line 463 of file g_local.h.

◆ MOD_HANDGRENADE

#define MOD_HANDGRENADE   15

Definition at line 472 of file g_local.h.

◆ MOD_HELD_GRENADE

#define MOD_HELD_GRENADE   24

Definition at line 481 of file g_local.h.

◆ MOD_HG_SPLASH

#define MOD_HG_SPLASH   16

Definition at line 473 of file g_local.h.

◆ MOD_HIT

#define MOD_HIT   32

Definition at line 489 of file g_local.h.

◆ MOD_HYPERBLASTER

#define MOD_HYPERBLASTER   10

Definition at line 467 of file g_local.h.

◆ MOD_LAVA

#define MOD_LAVA   19

Definition at line 476 of file g_local.h.

◆ MOD_MACHINEGUN

#define MOD_MACHINEGUN   4

Definition at line 461 of file g_local.h.

◆ MOD_R_SPLASH

#define MOD_R_SPLASH   9

Definition at line 466 of file g_local.h.

◆ MOD_RAILGUN

#define MOD_RAILGUN   11

Definition at line 468 of file g_local.h.

◆ MOD_ROCKET

#define MOD_ROCKET   8

Definition at line 465 of file g_local.h.

◆ MOD_SHOTGUN

#define MOD_SHOTGUN   2

Definition at line 459 of file g_local.h.

◆ MOD_SLIME

#define MOD_SLIME   18

Definition at line 475 of file g_local.h.

◆ MOD_SPLASH

#define MOD_SPLASH   29

Definition at line 486 of file g_local.h.

◆ MOD_SSHOTGUN

#define MOD_SSHOTGUN   3

Definition at line 460 of file g_local.h.

◆ MOD_SUICIDE

#define MOD_SUICIDE   23

Definition at line 480 of file g_local.h.

◆ MOD_TARGET_BLASTER

#define MOD_TARGET_BLASTER   33

Definition at line 490 of file g_local.h.

◆ MOD_TARGET_LASER

#define MOD_TARGET_LASER   30

Definition at line 487 of file g_local.h.

◆ MOD_TELEFRAG

#define MOD_TELEFRAG   21

Definition at line 478 of file g_local.h.

◆ MOD_TRIGGER_HURT

#define MOD_TRIGGER_HURT   31

Definition at line 488 of file g_local.h.

◆ MOD_UNKNOWN

#define MOD_UNKNOWN   0

Definition at line 457 of file g_local.h.

◆ MOD_WATER

#define MOD_WATER   17

Definition at line 474 of file g_local.h.

◆ PNOISE_IMPACT

#define PNOISE_IMPACT   2

Definition at line 181 of file g_local.h.

◆ PNOISE_SELF

#define PNOISE_SELF   0

Definition at line 179 of file g_local.h.

◆ PNOISE_WEAPON

#define PNOISE_WEAPON   1

Definition at line 180 of file g_local.h.

◆ POWER_ARMOR_NONE

#define POWER_ARMOR_NONE   0

Definition at line 156 of file g_local.h.

◆ POWER_ARMOR_SCREEN

#define POWER_ARMOR_SCREEN   1

Definition at line 157 of file g_local.h.

◆ POWER_ARMOR_SHIELD

#define POWER_ARMOR_SHIELD   2

Definition at line 158 of file g_local.h.

◆ random

#define random ( )    ((rand () & 0x7fff) / ((float)0x7fff))

Definition at line 504 of file g_local.h.

◆ RANGE_FAR

#define RANGE_FAR   3

Definition at line 119 of file g_local.h.

◆ RANGE_MELEE

#define RANGE_MELEE   0

Definition at line 116 of file g_local.h.

◆ RANGE_MID

#define RANGE_MID   2

Definition at line 118 of file g_local.h.

◆ RANGE_NEAR

#define RANGE_NEAR   1

Definition at line 117 of file g_local.h.

◆ RIGHT_HANDED

#define RIGHT_HANDED   0

Definition at line 161 of file g_local.h.

◆ SFL_CROSS_TRIGGER_1

#define SFL_CROSS_TRIGGER_1   0x00000001

Definition at line 167 of file g_local.h.

◆ SFL_CROSS_TRIGGER_2

#define SFL_CROSS_TRIGGER_2   0x00000002

Definition at line 168 of file g_local.h.

◆ SFL_CROSS_TRIGGER_3

#define SFL_CROSS_TRIGGER_3   0x00000004

Definition at line 169 of file g_local.h.

◆ SFL_CROSS_TRIGGER_4

#define SFL_CROSS_TRIGGER_4   0x00000008

Definition at line 170 of file g_local.h.

◆ SFL_CROSS_TRIGGER_5

#define SFL_CROSS_TRIGGER_5   0x00000010

Definition at line 171 of file g_local.h.

◆ SFL_CROSS_TRIGGER_6

#define SFL_CROSS_TRIGGER_6   0x00000020

Definition at line 172 of file g_local.h.

◆ SFL_CROSS_TRIGGER_7

#define SFL_CROSS_TRIGGER_7   0x00000040

Definition at line 173 of file g_local.h.

◆ SFL_CROSS_TRIGGER_8

#define SFL_CROSS_TRIGGER_8   0x00000080

Definition at line 174 of file g_local.h.

◆ SFL_CROSS_TRIGGER_MASK

#define SFL_CROSS_TRIGGER_MASK   0x000000ff

Definition at line 175 of file g_local.h.

◆ SPAWNFLAG_NOT_COOP

#define SPAWNFLAG_NOT_COOP   0x00001000

Definition at line 56 of file g_local.h.

◆ SPAWNFLAG_NOT_DEATHMATCH

#define SPAWNFLAG_NOT_DEATHMATCH   0x00000800

Definition at line 55 of file g_local.h.

◆ SPAWNFLAG_NOT_EASY

#define SPAWNFLAG_NOT_EASY   0x00000100

Definition at line 52 of file g_local.h.

◆ SPAWNFLAG_NOT_HARD

#define SPAWNFLAG_NOT_HARD   0x00000400

Definition at line 54 of file g_local.h.

◆ SPAWNFLAG_NOT_MEDIUM

#define SPAWNFLAG_NOT_MEDIUM   0x00000200

Definition at line 53 of file g_local.h.

◆ STOFS

#define STOFS (   x)    q_offsetof(spawn_temp_t, x)

Definition at line 499 of file g_local.h.

◆ svc_inventory

#define svc_inventory   5

Definition at line 40 of file g_local.h.

◆ svc_layout

#define svc_layout   4

Definition at line 39 of file g_local.h.

◆ svc_muzzleflash

#define svc_muzzleflash   1

Definition at line 36 of file g_local.h.

◆ svc_muzzleflash2

#define svc_muzzleflash2   2

Definition at line 37 of file g_local.h.

◆ svc_stufftext

#define svc_stufftext   11

Definition at line 41 of file g_local.h.

◆ svc_temp_entity

#define svc_temp_entity   3

Definition at line 38 of file g_local.h.

◆ TAG_GAME

#define TAG_GAME   765

Definition at line 78 of file g_local.h.

◆ TAG_LEVEL

#define TAG_LEVEL   766

Definition at line 79 of file g_local.h.

◆ WEAP_BFG

#define WEAP_BFG   11

Definition at line 229 of file g_local.h.

◆ WEAP_BLASTER

#define WEAP_BLASTER   1

Definition at line 219 of file g_local.h.

◆ WEAP_CHAINGUN

#define WEAP_CHAINGUN   5

Definition at line 223 of file g_local.h.

◆ WEAP_FLAREGUN

#define WEAP_FLAREGUN   12

Definition at line 230 of file g_local.h.

◆ WEAP_GRENADELAUNCHER

#define WEAP_GRENADELAUNCHER   7

Definition at line 225 of file g_local.h.

◆ WEAP_GRENADES

#define WEAP_GRENADES   6

Definition at line 224 of file g_local.h.

◆ WEAP_HYPERBLASTER

#define WEAP_HYPERBLASTER   9

Definition at line 227 of file g_local.h.

◆ WEAP_MACHINEGUN

#define WEAP_MACHINEGUN   4

Definition at line 222 of file g_local.h.

◆ WEAP_RAILGUN

#define WEAP_RAILGUN   10

Definition at line 228 of file g_local.h.

◆ WEAP_ROCKETLAUNCHER

#define WEAP_ROCKETLAUNCHER   8

Definition at line 226 of file g_local.h.

◆ WEAP_SHOTGUN

#define WEAP_SHOTGUN   2

Definition at line 220 of file g_local.h.

◆ WEAP_SUPERSHOTGUN

#define WEAP_SUPERSHOTGUN   3

Definition at line 221 of file g_local.h.

◆ world

#define world   (&g_edicts[0])

Definition at line 550 of file g_local.h.

Typedef Documentation

◆ gitem_t

typedef struct gitem_s gitem_t

Enumeration Type Documentation

◆ ammo_t

enum ammo_t
Enumerator
AMMO_BULLETS 
AMMO_SHELLS 
AMMO_ROCKETS 
AMMO_GRENADES 
AMMO_CELLS 
AMMO_SLUGS 

Definition at line 99 of file g_local.h.

99  {
100  AMMO_BULLETS,
101  AMMO_SHELLS,
102  AMMO_ROCKETS,
104  AMMO_CELLS,
105  AMMO_SLUGS
106 } ammo_t;

◆ damage_t

enum damage_t
Enumerator
DAMAGE_NO 
DAMAGE_YES 
DAMAGE_AIM 

Definition at line 86 of file g_local.h.

86  {
87  DAMAGE_NO,
88  DAMAGE_YES, // will take damage if hit
89  DAMAGE_AIM // auto targeting recognizes this
90 } damage_t;

◆ fieldtype_t

Enumerator
F_BAD 
F_BYTE 
F_SHORT 
F_INT 
F_FLOAT 
F_LSTRING 
F_GSTRING 
F_ZSTRING 
F_VECTOR 
F_ANGLEHACK 
F_EDICT 
F_ITEM 
F_CLIENT 
F_FUNCTION 
F_POINTER 
F_IGNORE 

Definition at line 565 of file g_local.h.

565  {
566  F_BAD,
567  F_BYTE,
568  F_SHORT,
569  F_INT,
570  F_FLOAT,
571  F_LSTRING, // string on disk, pointer in memory, TAG_LEVEL
572  F_GSTRING, // string on disk, pointer in memory, TAG_GAME
573  F_ZSTRING, // string on disk, string in memory
574  F_VECTOR,
575  F_ANGLEHACK,
576  F_EDICT, // index on disk, pointer in memory
577  F_ITEM, // index on disk, pointer in memory
578  F_CLIENT, // index on disk, pointer in memory
579  F_FUNCTION,
580  F_POINTER,
581  F_IGNORE
582 } fieldtype_t;

◆ movetype_t

enum movetype_t
Enumerator
MOVETYPE_NONE 
MOVETYPE_NOCLIP 
MOVETYPE_PUSH 
MOVETYPE_STOP 
MOVETYPE_WALK 
MOVETYPE_STEP 
MOVETYPE_FLY 
MOVETYPE_TOSS 
MOVETYPE_FLYMISSILE 
MOVETYPE_BOUNCE 

Definition at line 185 of file g_local.h.

185  {
186  MOVETYPE_NONE, // never moves
187  MOVETYPE_NOCLIP, // origin and angles change with no interaction
188  MOVETYPE_PUSH, // no clip to world, push on box contact
189  MOVETYPE_STOP, // no clip to world, stops on box contact
190 
191  MOVETYPE_WALK, // gravity
192  MOVETYPE_STEP, // gravity, special edge handling
193  MOVETYPE_FLY,
194  MOVETYPE_TOSS, // gravity
195  MOVETYPE_FLYMISSILE, // extra size to monsters
197 } movetype_t;

◆ weaponstate_t

Enumerator
WEAPON_READY 
WEAPON_ACTIVATING 
WEAPON_DROPPING 
WEAPON_FIRING 

Definition at line 92 of file g_local.h.

Function Documentation

◆ Add_Ammo()

qboolean Add_Ammo ( edict_t *  ent,
gitem_t item,
int  count 
)

Definition at line 426 of file g_items.c.

427 {
428  int index;
429  int max;
430 
431  if (!ent->client)
432  return qfalse;
433 
434  if (item->tag == AMMO_BULLETS)
435  max = ent->client->pers.max_bullets;
436  else if (item->tag == AMMO_SHELLS)
437  max = ent->client->pers.max_shells;
438  else if (item->tag == AMMO_ROCKETS)
439  max = ent->client->pers.max_rockets;
440  else if (item->tag == AMMO_GRENADES)
441  max = ent->client->pers.max_grenades;
442  else if (item->tag == AMMO_CELLS)
443  max = ent->client->pers.max_cells;
444  else if (item->tag == AMMO_SLUGS)
445  max = ent->client->pers.max_slugs;
446  else
447  return qfalse;
448 
449  index = ITEM_INDEX(item);
450 
451  if (ent->client->pers.inventory[index] == max)
452  return qfalse;
453 
454  ent->client->pers.inventory[index] += count;
455 
456  if (ent->client->pers.inventory[index] > max)
457  ent->client->pers.inventory[index] = max;
458 
459  return qtrue;
460 }

Referenced by Cmd_Give_f(), Pickup_Ammo(), and Pickup_Weapon().

◆ ai_charge()

void ai_charge ( edict_t *  self,
float  dist 
)

Definition at line 175 of file g_ai.c.

176 {
177  vec3_t v;
178 
179  VectorSubtract(self->enemy->s.origin, self->s.origin, v);
180  self->ideal_yaw = vectoyaw(v);
181  M_ChangeYaw(self);
182 
183  if (dist)
184  M_walkmove(self, self->s.angles[YAW], dist);
185 }

◆ ai_move()

void ai_move ( edict_t *  self,
float  dist 
)

Definition at line 86 of file g_ai.c.

87 {
88  M_walkmove(self, self->s.angles[YAW], dist);
89 }

◆ ai_run()

void ai_run ( edict_t *  self,
float  dist 
)

Definition at line 821 of file g_ai.c.

822 {
823  vec3_t v;
824  edict_t *tempgoal;
825  edict_t *save;
826  qboolean new;
827  edict_t *marker;
828  float d1, d2;
829  trace_t tr;
830  vec3_t v_forward, v_right;
831  float left, center, right;
832  vec3_t left_target, right_target;
833 
834  // if we're going to a combat point, just proceed
835  if (self->monsterinfo.aiflags & AI_COMBAT_POINT) {
836  M_MoveToGoal(self, dist);
837  return;
838  }
839 
840  if (self->monsterinfo.aiflags & AI_SOUND_TARGET) {
841  VectorSubtract(self->s.origin, self->enemy->s.origin, v);
842  if (VectorLength(v) < 64) {
843  self->monsterinfo.aiflags |= (AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
844  self->monsterinfo.stand(self);
845  return;
846  }
847 
848  M_MoveToGoal(self, dist);
849 
850  if (!FindTarget(self))
851  return;
852  }
853 
854  if (ai_checkattack(self, dist))
855  return;
856 
857  if (self->monsterinfo.attack_state == AS_SLIDING) {
858  ai_run_slide(self, dist);
859  return;
860  }
861 
862  if (enemy_vis) {
863 // if (self.aiflags & AI_LOST_SIGHT)
864 // dprint("regained sight\n");
865  M_MoveToGoal(self, dist);
866  self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
867  VectorCopy(self->enemy->s.origin, self->monsterinfo.last_sighting);
868  self->monsterinfo.trail_time = level.time;
869  return;
870  }
871 
872  // coop will change to another enemy if visible
873  if (coop->value) {
874  // FIXME: insane guys get mad with this, which causes crashes!
875  if (FindTarget(self))
876  return;
877  }
878 
879  if ((self->monsterinfo.search_time) && (level.time > (self->monsterinfo.search_time + 20))) {
880  M_MoveToGoal(self, dist);
881  self->monsterinfo.search_time = 0;
882 // dprint("search timeout\n");
883  return;
884  }
885 
886  save = self->goalentity;
887  tempgoal = G_Spawn();
888  self->goalentity = tempgoal;
889 
890  new = qfalse;
891 
892  if (!(self->monsterinfo.aiflags & AI_LOST_SIGHT)) {
893  // just lost sight of the player, decide where to go first
894 // dprint("lost sight of player, last seen at "); dprint(vtos(self.last_sighting)); dprint("\n");
895  self->monsterinfo.aiflags |= (AI_LOST_SIGHT | AI_PURSUIT_LAST_SEEN);
896  self->monsterinfo.aiflags &= ~(AI_PURSUE_NEXT | AI_PURSUE_TEMP);
897  new = qtrue;
898  }
899 
900  if (self->monsterinfo.aiflags & AI_PURSUE_NEXT) {
901  self->monsterinfo.aiflags &= ~AI_PURSUE_NEXT;
902 // dprint("reached current goal: "); dprint(vtos(self.origin)); dprint(" "); dprint(vtos(self.last_sighting)); dprint(" "); dprint(ftos(vlen(self.origin - self.last_sighting))); dprint("\n");
903 
904  // give ourself more time since we got this far
905  self->monsterinfo.search_time = level.time + 5;
906 
907  if (self->monsterinfo.aiflags & AI_PURSUE_TEMP) {
908 // dprint("was temp goal; retrying original\n");
909  self->monsterinfo.aiflags &= ~AI_PURSUE_TEMP;
910  marker = NULL;
911  VectorCopy(self->monsterinfo.saved_goal, self->monsterinfo.last_sighting);
912  new = qtrue;
913  } else if (self->monsterinfo.aiflags & AI_PURSUIT_LAST_SEEN) {
914  self->monsterinfo.aiflags &= ~AI_PURSUIT_LAST_SEEN;
915  marker = PlayerTrail_PickFirst(self);
916  } else {
917  marker = PlayerTrail_PickNext(self);
918  }
919 
920  if (marker) {
921  VectorCopy(marker->s.origin, self->monsterinfo.last_sighting);
922  self->monsterinfo.trail_time = marker->timestamp;
923  self->s.angles[YAW] = self->ideal_yaw = marker->s.angles[YAW];
924 // dprint("heading is "); dprint(ftos(self.ideal_yaw)); dprint("\n");
925 
926 // debug_drawline(self.origin, self.last_sighting, 52);
927  new = qtrue;
928  }
929  }
930 
931  VectorSubtract(self->s.origin, self->monsterinfo.last_sighting, v);
932  d1 = VectorLength(v);
933  if (d1 <= dist) {
934  self->monsterinfo.aiflags |= AI_PURSUE_NEXT;
935  dist = d1;
936  }
937 
938  VectorCopy(self->monsterinfo.last_sighting, self->goalentity->s.origin);
939 
940  if (new) {
941 // gi.dprintf("checking for course correction\n");
942 
943  tr = gi.trace(self->s.origin, self->mins, self->maxs, self->monsterinfo.last_sighting, self, MASK_PLAYERSOLID);
944  if (tr.fraction < 1) {
945  VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
946  d1 = VectorLength(v);
947  center = tr.fraction;
948  d2 = d1 * ((center + 1) / 2);
949  self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
950  AngleVectors(self->s.angles, v_forward, v_right, NULL);
951 
952  VectorSet(v, d2, -16, 0);
953  G_ProjectSource(self->s.origin, v, v_forward, v_right, left_target);
954  tr = gi.trace(self->s.origin, self->mins, self->maxs, left_target, self, MASK_PLAYERSOLID);
955  left = tr.fraction;
956 
957  VectorSet(v, d2, 16, 0);
958  G_ProjectSource(self->s.origin, v, v_forward, v_right, right_target);
959  tr = gi.trace(self->s.origin, self->mins, self->maxs, right_target, self, MASK_PLAYERSOLID);
960  right = tr.fraction;
961 
962  center = (d1 * center) / d2;
963  if (left >= center && left > right) {
964  if (left < 1) {
965  VectorSet(v, d2 * left * 0.5, -16, 0);
966  G_ProjectSource(self->s.origin, v, v_forward, v_right, left_target);
967 // gi.dprintf("incomplete path, go part way and adjust again\n");
968  }
969  VectorCopy(self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
970  self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
971  VectorCopy(left_target, self->goalentity->s.origin);
972  VectorCopy(left_target, self->monsterinfo.last_sighting);
973  VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
974  self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
975 // gi.dprintf("adjusted left\n");
976 // debug_drawline(self.origin, self.last_sighting, 152);
977  } else if (right >= center && right > left) {
978  if (right < 1) {
979  VectorSet(v, d2 * right * 0.5, 16, 0);
980  G_ProjectSource(self->s.origin, v, v_forward, v_right, right_target);
981 // gi.dprintf("incomplete path, go part way and adjust again\n");
982  }
983  VectorCopy(self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
984  self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
985  VectorCopy(right_target, self->goalentity->s.origin);
986  VectorCopy(right_target, self->monsterinfo.last_sighting);
987  VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
988  self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
989 // gi.dprintf("adjusted right\n");
990 // debug_drawline(self.origin, self.last_sighting, 152);
991  }
992  }
993 // else gi.dprintf("course was fine\n");
994  }
995 
996  M_MoveToGoal(self, dist);
997 
998  G_FreeEdict(tempgoal);
999 
1000  if (self)
1001  self->goalentity = save;
1002 }

◆ AI_SetSightClient()

void AI_SetSightClient ( void  )

Definition at line 47 of file g_ai.c.

48 {
49  edict_t *ent;
50  int start, check;
51 
52  if (level.sight_client == NULL)
53  start = 1;
54  else
55  start = level.sight_client - g_edicts;
56 
57  check = start;
58  while (1) {
59  check++;
60  if (check > game.maxclients)
61  check = 1;
62  ent = &g_edicts[check];
63  if (ent->inuse
64  && ent->health > 0
65  && !(ent->flags & FL_NOTARGET)) {
66  level.sight_client = ent;
67  return; // got one
68  }
69  if (check == start) {
70  level.sight_client = NULL;
71  return; // nobody to see
72  }
73  }
74 }

Referenced by G_RunFrame().

◆ ai_stand()

void ai_stand ( edict_t *  self,
float  dist 
)

Definition at line 100 of file g_ai.c.

101 {
102  vec3_t v;
103 
104  if (dist)
105  M_walkmove(self, self->s.angles[YAW], dist);
106 
107  if (self->monsterinfo.aiflags & AI_STAND_GROUND) {
108  if (self->enemy) {
109  VectorSubtract(self->enemy->s.origin, self->s.origin, v);
110  self->ideal_yaw = vectoyaw(v);
111  if (self->s.angles[YAW] != self->ideal_yaw && self->monsterinfo.aiflags & AI_TEMP_STAND_GROUND) {
112  self->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
113  self->monsterinfo.run(self);
114  }
115  M_ChangeYaw(self);
116  ai_checkattack(self, 0);
117  } else
118  FindTarget(self);
119  return;
120  }
121 
122  if (FindTarget(self))
123  return;
124 
125  if (level.time > self->monsterinfo.pausetime) {
126  self->monsterinfo.walk(self);
127  return;
128  }
129 
130  if (!(self->spawnflags & 1) && (self->monsterinfo.idle) && (level.time > self->monsterinfo.idle_time)) {
131  if (self->monsterinfo.idle_time) {
132  self->monsterinfo.idle(self);
133  self->monsterinfo.idle_time = level.time + 15 + random() * 15;
134  } else {
135  self->monsterinfo.idle_time = level.time + random() * 15;
136  }
137  }
138 }

◆ ai_turn()

void ai_turn ( edict_t *  self,
float  dist 
)

Definition at line 196 of file g_ai.c.

197 {
198  if (dist)
199  M_walkmove(self, self->s.angles[YAW], dist);
200 
201  if (FindTarget(self))
202  return;
203 
204  M_ChangeYaw(self);
205 }

◆ ai_walk()

void ai_walk ( edict_t *  self,
float  dist 
)

Definition at line 148 of file g_ai.c.

149 {
150  M_MoveToGoal(self, dist);
151 
152  // check for noticing a player
153  if (FindTarget(self))
154  return;
155 
156  if ((self->monsterinfo.search) && (level.time > self->monsterinfo.idle_time)) {
157  if (self->monsterinfo.idle_time) {
158  self->monsterinfo.search(self);
159  self->monsterinfo.idle_time = level.time + 15 + random() * 15;
160  } else {
161  self->monsterinfo.idle_time = level.time + random() * 15;
162  }
163  }
164 }

◆ ArmorIndex()

int ArmorIndex ( edict_t *  ent)

Definition at line 563 of file g_items.c.

564 {
565  if (!ent->client)
566  return 0;
567 
568  if (ent->client->pers.inventory[jacket_armor_index] > 0)
569  return jacket_armor_index;
570 
571  if (ent->client->pers.inventory[combat_armor_index] > 0)
572  return combat_armor_index;
573 
574  if (ent->client->pers.inventory[body_armor_index] > 0)
575  return body_armor_index;
576 
577  return 0;
578 }

Referenced by CheckArmor(), G_SetStats(), and Pickup_Armor().

◆ AttackFinished()

void AttackFinished ( edict_t *  self,
float  time 
)

Definition at line 133 of file g_monster.c.

134 {
135  self->monsterinfo.attack_finished = level.time + time;
136 }

Referenced by HuntTarget().

◆ BecomeExplosion1()

void BecomeExplosion1 ( edict_t *  self)

Definition at line 297 of file g_misc.c.

298 {
299  gi.WriteByte(svc_temp_entity);
300  gi.WriteByte(TE_EXPLOSION1);
301  gi.WritePosition(self->s.origin);
302  gi.multicast(self->s.origin, MULTICAST_PVS);
303 
304  G_FreeEdict(self);
305 }

Referenced by barrel_explode(), door_blocked(), door_secret_blocked(), floater_die(), flyer_die(), func_explosive_explode(), hover_deadthink(), plat_blocked(), and train_blocked().

◆ BeginIntermission()

void BeginIntermission ( edict_t *  targ)

Definition at line 70 of file p_hud.c.

71 {
72  int i, n;
73  edict_t *ent, *client;
74 
76  return; // already activated
77 
78  game.autosaved = qfalse;
79 
80  // respawn any dead clients
81  for (i = 0 ; i < maxclients->value ; i++) {
82  client = g_edicts + 1 + i;
83  if (!client->inuse)
84  continue;
85  if (client->health <= 0)
86  respawn(client);
87  }
88 
90  level.changemap = targ->map;
91 
92  if (strstr(level.changemap, "*")) {
93  if (coop->value) {
94  for (i = 0 ; i < maxclients->value ; i++) {
95  client = g_edicts + 1 + i;
96  if (!client->inuse)
97  continue;
98  // strip players of all keys between units
99  for (n = 0; n < MAX_ITEMS; n++) {
100  if (itemlist[n].flags & IT_KEY)
101  client->client->pers.inventory[n] = 0;
102  }
103  }
104  }
105  } else {
106  if (!deathmatch->value) {
107  level.exitintermission = 1; // go immediately to the next level
108  return;
109  }
110  }
111 
113 
114  // find an intermission spot
115  ent = G_Find(NULL, FOFS(classname), "info_player_intermission");
116  if (!ent) {
117  // the map creator forgot to put in an intermission point...
118  ent = G_Find(NULL, FOFS(classname), "info_player_start");
119  if (!ent)
120  ent = G_Find(NULL, FOFS(classname), "info_player_deathmatch");
121  } else {
122  // chose one of four spots
123  i = rand() & 3;
124  while (i--) {
125  ent = G_Find(ent, FOFS(classname), "info_player_intermission");
126  if (!ent) // wrap around the list
127  ent = G_Find(ent, FOFS(classname), "info_player_intermission");
128  }
129  }
130 
131  VectorCopy(ent->s.origin, level.intermission_origin);
132  VectorCopy(ent->s.angles, level.intermission_angle);
133 
134  // move all clients to the intermission point
135  for (i = 0 ; i < maxclients->value ; i++) {
136  client = g_edicts + 1 + i;
137  if (!client->inuse)
138  continue;
139  MoveClientToIntermission(client);
140  }
141 }

Referenced by EndDMLevel(), and use_target_changelevel().

◆ CanDamage()

qboolean CanDamage ( edict_t *  targ,
edict_t *  inflictor 
)

Definition at line 30 of file g_combat.c.

31 {
32  vec3_t dest;
33  trace_t trace;
34 
35 // bmodels need special checking because their origin is 0,0,0
36  if (targ->movetype == MOVETYPE_PUSH) {
37  VectorAdd(targ->absmin, targ->absmax, dest);
38  VectorScale(dest, 0.5, dest);
39  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
40  if (trace.fraction == 1.0)
41  return qtrue;
42  if (trace.ent == targ)
43  return qtrue;
44  return qfalse;
45  }
46 
47  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, targ->s.origin, inflictor, MASK_SOLID);
48  if (trace.fraction == 1.0)
49  return qtrue;
50 
51  VectorCopy(targ->s.origin, dest);
52  dest[0] += 15.0;
53  dest[1] += 15.0;
54  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
55  if (trace.fraction == 1.0)
56  return qtrue;
57 
58  VectorCopy(targ->s.origin, dest);
59  dest[0] += 15.0;
60  dest[1] -= 15.0;
61  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
62  if (trace.fraction == 1.0)
63  return qtrue;
64 
65  VectorCopy(targ->s.origin, dest);
66  dest[0] -= 15.0;
67  dest[1] += 15.0;
68  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
69  if (trace.fraction == 1.0)
70  return qtrue;
71 
72  VectorCopy(targ->s.origin, dest);
73  dest[0] -= 15.0;
74  dest[1] -= 15.0;
75  trace = gi.trace(inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
76  if (trace.fraction == 1.0)
77  return qtrue;
78 
79 
80  return qfalse;
81 }

Referenced by bfg_explode(), and T_RadiusDamage().

◆ ChangeWeapon()

void ChangeWeapon ( edict_t *  ent)

Definition at line 162 of file p_weapon.c.

163 {
164  int i;
165 
166  if (ent->client->grenade_time) {
167  ent->client->grenade_time = level.time;
168  ent->client->weapon_sound = 0;
169  weapon_grenade_fire(ent, qfalse);
170  ent->client->grenade_time = 0;
171  }
172 
173  ent->client->pers.lastweapon = ent->client->pers.weapon;
174  ent->client->pers.weapon = ent->client->newweapon;
175  ent->client->newweapon = NULL;
176  ent->client->machinegun_shots = 0;
177 
178  // set visible model
179  if (ent->s.modelindex == 255) {
180  if (ent->client->pers.weapon)
181  i = ((ent->client->pers.weapon->weapmodel & 0xff) << 8);
182  else
183  i = 0;
184  ent->s.skinnum = (ent - g_edicts - 1) | i;
185  }
186 
187  if (ent->client->pers.weapon && ent->client->pers.weapon->ammo)
188  ent->client->ammo_index = ITEM_INDEX(FindItem(ent->client->pers.weapon->ammo));
189  else
190  ent->client->ammo_index = 0;
191 
192  if (!ent->client->pers.weapon) {
193  // dead
194  ent->client->ps.gunindex = 0;
195  return;
196  }
197 
198  ent->client->weaponstate = WEAPON_ACTIVATING;
199  ent->client->ps.gunframe = 0;
200  ent->client->ps.gunindex = gi.modelindex(ent->client->pers.weapon->view_model);
201 
202  ent->client->anim_priority = ANIM_PAIN;
203  if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
204  ent->s.frame = FRAME_crpain1;
205  ent->client->anim_end = FRAME_crpain4;
206  } else {
207  ent->s.frame = FRAME_pain301;
208  ent->client->anim_end = FRAME_pain304;
209 
210  }
211 }

Referenced by PutClientInServer(), Think_Weapon(), Weapon_Generic(), and Weapon_Grenade().

◆ ChaseNext()

void ChaseNext ( edict_t *  ent)

Definition at line 107 of file g_chase.c.

108 {
109  int i;
110  edict_t *e;
111 
112  if (!ent->client->chase_target)
113  return;
114 
115  i = ent->client->chase_target - g_edicts;
116  do {
117  i++;
118  if (i > maxclients->value)
119  i = 1;
120  e = g_edicts + i;
121  if (!e->inuse)
122  continue;
123  if (!e->client->resp.spectator)
124  break;
125  } while (e != ent->client->chase_target);
126 
127  ent->client->chase_target = e;
128  ent->client->update_chase = qtrue;
129 }

Referenced by ClientThink(), SelectNextItem(), and UpdateChaseCam().

◆ ChasePrev()

void ChasePrev ( edict_t *  ent)

Definition at line 131 of file g_chase.c.

132 {
133  int i;
134  edict_t *e;
135 
136  if (!ent->client->chase_target)
137  return;
138 
139  i = ent->client->chase_target - g_edicts;
140  do {
141  i--;
142  if (i < 1)
143  i = maxclients->value;
144  e = g_edicts + i;
145  if (!e->inuse)
146  continue;
147  if (!e->client->resp.spectator)
148  break;
149  } while (e != ent->client->chase_target);
150 
151  ent->client->chase_target = e;
152  ent->client->update_chase = qtrue;
153 }

Referenced by SelectPrevItem().

◆ ClientBeginServerFrame()

void ClientBeginServerFrame ( edict_t *  ent)

Definition at line 1709 of file p_client.c.

1710 {
1711  gclient_t *client;
1712  int buttonMask;
1713 
1714  if (level.intermissiontime)
1715  return;
1716 
1717  client = ent->client;
1718 
1719  if (deathmatch->value &&
1720  client->pers.spectator != client->resp.spectator &&
1721  (level.time - client->respawn_time) >= 5) {
1722  spectator_respawn(ent);
1723  return;
1724  }
1725 
1726  // run weapon animations if it hasn't been done by a ucmd_t
1727  if (!client->weapon_thunk && !client->resp.spectator)
1728  Think_Weapon(ent);
1729  else
1730  client->weapon_thunk = qfalse;
1731 
1732  if (ent->deadflag) {
1733  // wait for any button just going down
1734  if (level.time > client->respawn_time) {
1735  // in deathmatch, only wait for attack button
1736  if (deathmatch->value)
1737  buttonMask = BUTTON_ATTACK;
1738  else
1739  buttonMask = -1;
1740 
1741  if ((client->latched_buttons & buttonMask) ||
1742  (deathmatch->value && ((int)dmflags->value & DF_FORCE_RESPAWN))) {
1743  respawn(ent);
1744  client->latched_buttons = 0;
1745  }
1746  }
1747  return;
1748  }
1749 
1750  // add player trail so monsters can follow
1751  if (!deathmatch->value)
1752  if (!visible(ent, PlayerTrail_LastSpot()))
1753  PlayerTrail_Add(ent->s.old_origin);
1754 
1755  client->latched_buttons = 0;
1756 }

Referenced by G_RunFrame().

◆ ClientEndServerFrame()

void ClientEndServerFrame ( edict_t *  ent)

Definition at line 889 of file p_view.c.

890 {
891  float bobtime;
892  int i;
893 
894  current_player = ent;
895  current_client = ent->client;
896 
897  //
898  // If the origin or velocity have changed since ClientThink(),
899  // update the pmove values. This will happen when the client
900  // is pushed by a bmodel or kicked by an explosion.
901  //
902  // If it wasn't updated here, the view position would lag a frame
903  // behind the body position when pushed -- "sinking into plats"
904  //
905  for (i = 0 ; i < 3 ; i++) {
906  current_client->ps.pmove.origin[i] = ent->s.origin[i] * 8.0;
907  current_client->ps.pmove.velocity[i] = ent->velocity[i] * 8.0;
908  }
909 
910  //
911  // If the end of unit layout is displayed, don't give
912  // the player any normal movement attributes
913  //
914  if (level.intermissiontime) {
915  // FIXME: add view drifting here?
916  current_client->ps.blend[3] = 0;
917  current_client->ps.fov = 90;
918  G_SetStats(ent);
919  return;
920  }
921 
922  AngleVectors(ent->client->v_angle, forward, right, up);
923 
924  // burn from lava, etc
925  P_WorldEffects();
926 
927  //
928  // set model angles from view angles so other things in
929  // the world can tell which direction you are looking
930  //
931  if (ent->client->v_angle[PITCH] > 180)
932  ent->s.angles[PITCH] = (-360 + ent->client->v_angle[PITCH]) / 3;
933  else
934  ent->s.angles[PITCH] = ent->client->v_angle[PITCH] / 3;
935  ent->s.angles[YAW] = ent->client->v_angle[YAW];
936  ent->s.angles[ROLL] = 0;
937  ent->s.angles[ROLL] = SV_CalcRoll(ent->s.angles, ent->velocity) * 4;
938 
939  //
940  // calculate speed and cycle to be used for
941  // all cyclic walking effects
942  //
943  xyspeed = sqrt(ent->velocity[0] * ent->velocity[0] + ent->velocity[1] * ent->velocity[1]);
944 
945  if (xyspeed < 5) {
946  bobmove = 0;
947  current_client->bobtime = 0; // start at beginning of cycle again
948  } else if (ent->groundentity) {
949  // so bobbing only cycles when on ground
950  if (xyspeed > 210)
951  bobmove = 0.25;
952  else if (xyspeed > 100)
953  bobmove = 0.125;
954  else
955  bobmove = 0.0625;
956  }
957 
958  bobtime = (current_client->bobtime += bobmove);
959 
960  if (current_client->ps.pmove.pm_flags & PMF_DUCKED)
961  bobtime *= 4;
962 
963  bobcycle = (int)bobtime;
964  bobfracsin = fabs(sin(bobtime * M_PI));
965 
966  // detect hitting the floor
967  P_FallingDamage(ent);
968 
969  // apply all the damage taken this frame
970  P_DamageFeedback(ent);
971 
972  // determine the view offsets
973  SV_CalcViewOffset(ent);
974 
975  // determine the gun offsets
976  SV_CalcGunOffset(ent);
977 
978  // determine the full screen color blend
979  // must be after viewoffset, so eye contents can be
980  // accurately determined
981  // FIXME: with client prediction, the contents
982  // should be determined by the client
983  SV_CalcBlend(ent);
984 
985  // chase cam stuff
986  if (ent->client->resp.spectator)
987  G_SetSpectatorStats(ent);
988  else
989  G_SetStats(ent);
990  G_CheckChaseStats(ent);
991 
992  G_SetClientEvent(ent);
993 
994  G_SetClientEffects(ent);
995 
996  G_SetClientSound(ent);
997 
998  G_SetClientFrame(ent);
999 
1000  VectorCopy(ent->velocity, ent->client->oldvelocity);
1001  VectorCopy(ent->client->ps.viewangles, ent->client->oldviewangles);
1002 
1003  // clear weapon kicks
1004  VectorClear(ent->client->kick_origin);
1005  VectorClear(ent->client->kick_angles);
1006 
1007  // if the scoreboard is up, update it
1008  if (ent->client->showscores && !(level.framenum & 31)) {
1009  DeathmatchScoreboardMessage(ent, ent->enemy);
1010  gi.unicast(ent, qfalse);
1011  }
1012 }

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

◆ Cmd_Help_f()

void Cmd_Help_f ( edict_t *  ent)

Definition at line 324 of file p_hud.c.

325 {
326  // this is for backwards compatability
327  if (deathmatch->value) {
328  Cmd_Score_f(ent);
329  return;
330  }
331 
332  ent->client->showinventory = qfalse;
333  ent->client->showscores = qfalse;
334 
335  if (ent->client->showhelp && (ent->client->pers.game_helpchanged == game.helpchanged)) {
336  ent->client->showhelp = qfalse;
337  return;
338  }
339 
340  ent->client->showhelp = qtrue;
341  ent->client->pers.helpchanged = 0;
342  HelpComputer(ent);
343 }

Referenced by ClientCommand(), and player_die().

◆ Cmd_Score_f()

void Cmd_Score_f ( edict_t *  ent)

Definition at line 255 of file p_hud.c.

256 {
257  ent->client->showinventory = qfalse;
258  ent->client->showhelp = qfalse;
259 
260  if (!deathmatch->value && !coop->value)
261  return;
262 
263  if (ent->client->showscores) {
264  ent->client->showscores = qfalse;
265  return;
266  }
267 
268  ent->client->showscores = qtrue;
270 }

Referenced by ClientCommand(), and Cmd_Help_f().

◆ DeathmatchScoreboardMessage()

void DeathmatchScoreboardMessage ( edict_t *  client,
edict_t *  killer 
)

Definition at line 150 of file p_hud.c.

151 {
152  char entry[1024];
153  char string[1400];
154  int stringlength;
155  int i, j, k;
156  int sorted[MAX_CLIENTS];
157  int sortedscores[MAX_CLIENTS];
158  int score, total;
159  int x, y;
160  gclient_t *cl;
161  edict_t *cl_ent;
162  char *tag;
163 
164  // sort the clients by score
165  total = 0;
166  for (i = 0 ; i < game.maxclients ; i++) {
167  cl_ent = g_edicts + 1 + i;
168  if (!cl_ent->inuse || game.clients[i].resp.spectator)
169  continue;
170  score = game.clients[i].resp.score;
171  for (j = 0 ; j < total ; j++) {
172  if (score > sortedscores[j])
173  break;
174  }
175  for (k = total ; k > j ; k--) {
176  sorted[k] = sorted[k - 1];
177  sortedscores[k] = sortedscores[k - 1];
178  }
179  sorted[j] = i;
180  sortedscores[j] = score;
181  total++;
182  }
183 
184  // print level name and exit rules
185  string[0] = 0;
186 
187  stringlength = strlen(string);
188 
189  // add the clients in sorted order
190  if (total > 12)
191  total = 12;
192 
193  for (i = 0 ; i < total ; i++) {
194  cl = &game.clients[sorted[i]];
195  cl_ent = g_edicts + 1 + sorted[i];
196 
197  x = (i >= 6) ? 160 : 0;
198  y = 32 + 32 * (i % 6);
199 
200  // add a dogtag
201  if (cl_ent == ent)
202  tag = "tag1";
203  else if (cl_ent == killer)
204  tag = "tag2";
205  else
206  tag = NULL;
207  if (tag) {
208  Q_snprintf(entry, sizeof(entry),
209  "xv %i yv %i picn %s ", x + 32, y, tag);
210  j = strlen(entry);
211  if (stringlength + j > 1024)
212  break;
213  strcpy(string + stringlength, entry);
214  stringlength += j;
215  }
216 
217  // send the layout
218  Q_snprintf(entry, sizeof(entry),
219  "client %i %i %i %i %i %i ",
220  x, y, sorted[i], cl->resp.score, cl->ping, (level.framenum - cl->resp.enterframe) / 600);
221  j = strlen(entry);
222  if (stringlength + j > 1024)
223  break;
224  strcpy(string + stringlength, entry);
225  stringlength += j;
226  }
227 
228  gi.WriteByte(svc_layout);
229  gi.WriteString(string);
230 }

Referenced by ClientEndServerFrame(), DeathmatchScoreboard(), and MoveClientToIntermission().

◆ Drop_Item()

edict_t* Drop_Item ( edict_t *  ent,
gitem_t item 
)

Definition at line 798 of file g_items.c.

799 {
800  edict_t *dropped;
801  vec3_t forward, right;
802  vec3_t offset;
803 
804  dropped = G_Spawn();
805 
806  dropped->classname = item->classname;
807  dropped->item = item;
808  dropped->spawnflags = DROPPED_ITEM;
809  dropped->s.effects = item->world_model_flags;
810  dropped->s.renderfx = RF_GLOW;
811  VectorSet(dropped->mins, -15, -15, -15);
812  VectorSet(dropped->maxs, 15, 15, 15);
813  gi.setmodel(dropped, dropped->item->world_model);
814  dropped->solid = SOLID_TRIGGER;
815  dropped->movetype = MOVETYPE_TOSS;
816  dropped->touch = drop_temp_touch;
817  dropped->owner = ent;
818 
819  if (ent->client) {
820  trace_t trace;
821 
822  AngleVectors(ent->client->v_angle, forward, right, NULL);
823  VectorSet(offset, 24, 0, -16);
824  G_ProjectSource(ent->s.origin, offset, forward, right, dropped->s.origin);
825  trace = gi.trace(ent->s.origin, dropped->mins, dropped->maxs,
826  dropped->s.origin, ent, CONTENTS_SOLID);
827  VectorCopy(trace.endpos, dropped->s.origin);
828  } else {
829  AngleVectors(ent->s.angles, forward, right, NULL);
830  VectorCopy(ent->s.origin, dropped->s.origin);
831  }
832 
833  VectorScale(forward, 100, dropped->velocity);
834  dropped->velocity[2] = 300;
835 
836  dropped->think = drop_make_touchable;
837  dropped->nextthink = level.time + 1;
838 
839  gi.linkentity(dropped);
840 
841  return dropped;
842 }

Referenced by Drop_Ammo(), Drop_General(), Drop_Weapon(), monster_death_use(), and TossClientWeapon().

◆ FacingIdeal()

qboolean FacingIdeal ( edict_t *  self)

Definition at line 540 of file g_ai.c.

541 {
542  float delta;
543 
544  delta = anglemod(self->s.angles[YAW] - self->ideal_yaw);
545  if (delta > 45 && delta < 315)
546  return qfalse;
547  return qtrue;
548 }

Referenced by ai_run_melee(), and ai_run_missile().

◆ FetchClientEntData()

void FetchClientEntData ( edict_t *  ent)

Definition at line 652 of file p_client.c.

653 {
654  ent->health = ent->client->pers.health;
655  ent->max_health = ent->client->pers.max_health;
656  ent->flags |= ent->client->pers.savedFlags;
657  if (coop->value)
658  ent->client->resp.score = ent->client->pers.score;
659 }

Referenced by PutClientInServer().

◆ FindItem()

gitem_t* FindItem ( char *  pickup_name)

Definition at line 98 of file g_items.c.

99 {
100  int i;
101  gitem_t *it;
102 
103  it = itemlist;
104  for (i = 0 ; i < game.num_items ; i++, it++) {
105  if (!it->pickup_name)
106  continue;
107  if (!Q_stricmp(it->pickup_name, pickup_name))
108  return it;
109  }
110 
111  return NULL;
112 }

Referenced by ChangeWeapon(), CheckPowerArmor(), Cmd_Drop_f(), Cmd_Give_f(), Cmd_Use_f(), G_SetStats(), InitClientPersistant(), NoAmmoWeaponChange(), Pickup_Ammo(), Pickup_Bandolier(), Pickup_Pack(), Pickup_Weapon(), PrecacheItem(), SetItemNames(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_worldspawn(), Use_PowerArmor(), and Use_Weapon().

◆ FindItemByClassname()

gitem_t* FindItemByClassname ( char *  classname)

Definition at line 76 of file g_items.c.

77 {
78  int i;
79  gitem_t *it;
80 
81  it = itemlist;
82  for (i = 0 ; i < game.num_items ; i++, it++) {
83  if (!it->classname)
84  continue;
85  if (!Q_stricmp(it->classname, classname))
86  return it;
87  }
88 
89  return NULL;
90 }

Referenced by monster_start(), SP_trigger_key(), SP_turret_driver(), and TossClientWeapon().

◆ findradius()

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

Definition at line 75 of file g_utils.c.

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

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

◆ fire_bfg()

void fire_bfg ( edict_t *  self,
vec3_t  start,
vec3_t  dir,
int  damage,
int  speed,
float  damage_radius 
)

Definition at line 830 of file g_weapon.c.

831 {
832  edict_t *bfg;
833 
834  bfg = G_Spawn();
835  VectorCopy(start, bfg->s.origin);
836  VectorCopy(dir, bfg->movedir);
837  vectoangles(dir, bfg->s.angles);
838  VectorScale(dir, speed, bfg->velocity);
839  bfg->movetype = MOVETYPE_FLYMISSILE;
840  bfg->clipmask = MASK_SHOT;
841  bfg->solid = SOLID_BBOX;
842  bfg->s.effects |= EF_BFG | EF_ANIM_ALLFAST;
843  VectorClear(bfg->mins);
844  VectorClear(bfg->maxs);
845  bfg->s.modelindex = gi.modelindex("sprites/s_bfg1.sp2");
846  bfg->owner = self;
847  bfg->touch = bfg_touch;
848  bfg->nextthink = level.time + 8000 / speed;
849  bfg->think = G_FreeEdict;
850  bfg->radius_dmg = damage;
851  bfg->dmg_radius = damage_radius;
852  bfg->classname = "bfg blast";
853  bfg->s.sound = gi.soundindex("weapons/bfg__l1a.wav");
854 
855  bfg->think = bfg_think;
856  bfg->nextthink = level.time + FRAMETIME;
857  bfg->teammaster = bfg;
858  bfg->teamchain = NULL;
859 
860  if (self->client)
861  check_dodge(self, bfg->s.origin, dir, speed);
862 
863  gi.linkentity(bfg);
864 }

Referenced by monster_fire_bfg(), and weapon_bfg_fire().

◆ fire_blaster()

void fire_blaster ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  speed,
int  effect,
qboolean  hyper 
)

Definition at line 319 of file g_weapon.c.

320 {
321  edict_t *bolt;
322  trace_t tr;
323 
324  VectorNormalize(dir);
325 
326  bolt = G_Spawn();
327  bolt->svflags = SVF_DEADMONSTER;
328  // yes, I know it looks weird that projectiles are deadmonsters
329  // what this means is that when prediction is used against the object
330  // (blaster/hyperblaster shots), the player won't be solid clipped against
331  // the object. Right now trying to run into a firing hyperblaster
332  // is very jerky since you are predicted 'against' the shots.
333  VectorCopy(start, bolt->s.origin);
334  VectorCopy(start, bolt->s.old_origin);
335  vectoangles(dir, bolt->s.angles);
336  VectorScale(dir, speed, bolt->velocity);
337  bolt->movetype = MOVETYPE_FLYMISSILE;
338  bolt->clipmask = MASK_SHOT;
339  bolt->solid = SOLID_BBOX;
340  bolt->s.effects |= effect;
341  VectorClear(bolt->mins);
342  VectorClear(bolt->maxs);
343  bolt->s.modelindex = gi.modelindex("models/objects/laser/tris.md2");
344  bolt->s.sound = gi.soundindex("misc/lasfly.wav");
345  bolt->owner = self;
346  bolt->touch = blaster_touch;
347  bolt->nextthink = level.time + 2;
348  bolt->think = G_FreeEdict;
349  bolt->dmg = damage;
350  bolt->classname = "bolt";
351  if (hyper)
352  bolt->spawnflags = 1;
353  gi.linkentity(bolt);
354 
355  if (self->client)
356  check_dodge(self, bolt->s.origin, dir, speed);
357 
358  tr = gi.trace(self->s.origin, NULL, NULL, bolt->s.origin, bolt, MASK_SHOT);
359  if (tr.fraction < 1.0) {
360  VectorMA(bolt->s.origin, -10, dir, bolt->s.origin);
361  bolt->touch(bolt, tr.ent, NULL, NULL);
362  }
363 }

Referenced by Blaster_Fire(), monster_fire_blaster(), and use_target_blaster().

◆ fire_bullet()

void fire_bullet ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  kick,
int  hspread,
int  vspread,
int  mod 
)

Definition at line 255 of file g_weapon.c.

256 {
257  fire_lead(self, start, aimdir, damage, kick, TE_GUNSHOT, hspread, vspread, mod);
258 }

Referenced by Chaingun_Fire(), Machinegun_Fire(), and monster_fire_bullet().

◆ fire_grenade()

void fire_grenade ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  speed,
float  timer,
float  damage_radius 
)

Definition at line 450 of file g_weapon.c.

451 {
452  edict_t *grenade;
453  vec3_t dir;
454  vec3_t forward, right, up;
455 
456  vectoangles(aimdir, dir);
457  AngleVectors(dir, forward, right, up);
458 
459  grenade = G_Spawn();
460  VectorCopy(start, grenade->s.origin);
461  VectorScale(aimdir, speed, grenade->velocity);
462  VectorMA(grenade->velocity, 200 + crandom() * 10.0, up, grenade->velocity);
463  VectorMA(grenade->velocity, crandom() * 10.0, right, grenade->velocity);
464  VectorSet(grenade->avelocity, 300, 300, 300);
465  grenade->movetype = MOVETYPE_BOUNCE;
466  grenade->clipmask = MASK_SHOT;
467  grenade->solid = SOLID_BBOX;
468  grenade->s.effects |= EF_GRENADE;
469  VectorClear(grenade->mins);
470  VectorClear(grenade->maxs);
471  grenade->s.modelindex = gi.modelindex("models/objects/grenade/tris.md2");
472  grenade->owner = self;
473  grenade->touch = Grenade_Touch;
474  grenade->nextthink = level.time + timer;
475  grenade->think = Grenade_Explode;
476  grenade->dmg = damage;
477  grenade->dmg_radius = damage_radius;
478  grenade->classname = "grenade";
479 
480  gi.linkentity(grenade);
481 }

Referenced by monster_fire_grenade(), and weapon_grenadelauncher_fire().

◆ fire_grenade2()

void fire_grenade2 ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  speed,
float  timer,
float  damage_radius,
qboolean  held 
)

Definition at line 483 of file g_weapon.c.

484 {
485  edict_t *grenade;
486  vec3_t dir;
487  vec3_t forward, right, up;
488 
489  vectoangles(aimdir, dir);
490  AngleVectors(dir, forward, right, up);
491 
492  grenade = G_Spawn();
493  VectorCopy(start, grenade->s.origin);
494  VectorScale(aimdir, speed, grenade->velocity);
495  VectorMA(grenade->velocity, 200 + crandom() * 10.0, up, grenade->velocity);
496  VectorMA(grenade->velocity, crandom() * 10.0, right, grenade->velocity);
497  VectorSet(grenade->avelocity, 300, 300, 300);
498  grenade->movetype = MOVETYPE_BOUNCE;
499  grenade->clipmask = MASK_SHOT;
500  grenade->solid = SOLID_BBOX;
501  grenade->s.effects |= EF_GRENADE;
502  VectorClear(grenade->mins);
503  VectorClear(grenade->maxs);
504  grenade->s.modelindex = gi.modelindex("models/objects/grenade2/tris.md2");
505  grenade->owner = self;
506  grenade->touch = Grenade_Touch;
507  grenade->nextthink = level.time + timer;
508  grenade->think = Grenade_Explode;
509  grenade->dmg = damage;
510  grenade->dmg_radius = damage_radius;
511  grenade->classname = "hgrenade";
512  if (held)
513  grenade->spawnflags = 3;
514  else
515  grenade->spawnflags = 1;
516  grenade->s.sound = gi.soundindex("weapons/hgrenc1b.wav");
517 
518  if (timer <= 0.0)
519  Grenade_Explode(grenade);
520  else {
521  gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/hgrent1a.wav"), 1, ATTN_NORM, 0);
522  gi.linkentity(grenade);
523  }
524 }

Referenced by weapon_grenade_fire().

◆ fire_hit()

qboolean fire_hit ( edict_t *  self,
vec3_t  aim,
int  damage,
int  kick 
)

Definition at line 59 of file g_weapon.c.

60 {
61  trace_t tr;
62  vec3_t forward, right, up;
63  vec3_t v;
64  vec3_t point;
65  float range;
66  vec3_t dir;
67 
68  //see if enemy is in range
69  VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
70  range = VectorLength(dir);
71  if (range > aim[0])
72  return qfalse;
73 
74  if (aim[1] > self->mins[0] && aim[1] < self->maxs[0]) {
75  // the hit is straight on so back the range up to the edge of their bbox
76  range -= self->enemy->maxs[0];
77  } else {
78  // this is a side hit so adjust the "right" value out to the edge of their bbox
79  if (aim[1] < 0)
80  aim[1] = self->enemy->mins[0];
81  else
82  aim[1] = self->enemy->maxs[0];
83  }
84 
85  VectorMA(self->s.origin, range, dir, point);
86 
87  tr = gi.trace(self->s.origin, NULL, NULL, point, self, MASK_SHOT);
88  if (tr.fraction < 1) {
89  if (!tr.ent->takedamage)
90  return qfalse;
91  // if it will hit any client/monster then hit the one we wanted to hit
92  if ((tr.ent->svflags & SVF_MONSTER) || (tr.ent->client))
93  tr.ent = self->enemy;
94  }
95 
96  AngleVectors(self->s.angles, forward, right, up);
97  VectorMA(self->s.origin, range, forward, point);
98  VectorMA(point, aim[1], right, point);
99  VectorMA(point, aim[2], up, point);
100  VectorSubtract(point, self->enemy->s.origin, dir);
101 
102  // do the damage
103  T_Damage(tr.ent, self, self, dir, point, vec3_origin, damage, kick / 2, DAMAGE_NO_KNOCKBACK, MOD_HIT);
104 
105  if (!(tr.ent->svflags & SVF_MONSTER) && (!tr.ent->client))
106  return qfalse;
107 
108  // do our special form of knockback here
109  VectorMA(self->enemy->absmin, 0.5, self->enemy->size, v);
110  VectorSubtract(v, point, v);
111  VectorNormalize(v);
112  VectorMA(self->enemy->velocity, kick, v, self->enemy->velocity);
113  if (self->enemy->velocity[2] > 0)
114  self->enemy->groundentity = NULL;
115  return qtrue;
116 }

Referenced by berserk_attack_club(), berserk_attack_spike(), brain_hit_left(), brain_hit_right(), brain_tentacle_attack(), ChickSlash(), flipper_bite(), floater_wham(), flyer_slash_left(), flyer_slash_right(), GaldiatorMelee(), infantry_smack(), mutant_hit_left(), and mutant_hit_right().

◆ fire_rail()

void fire_rail ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  kick 
)

Definition at line 615 of file g_weapon.c.

616 {
617  vec3_t from;
618  vec3_t end;
619  trace_t tr;
620  edict_t *ignore;
621  int mask;
622  qboolean water;
623 
624  VectorMA(start, 8192, aimdir, end);
625  VectorCopy(start, from);
626  ignore = self;
627  water = qfalse;
628  mask = MASK_SHOT | CONTENTS_SLIME | CONTENTS_LAVA;
629  while (ignore) {
630  tr = gi.trace(from, NULL, NULL, end, ignore, mask);
631 
632  if (tr.contents & (CONTENTS_SLIME | CONTENTS_LAVA)) {
633  mask &= ~(CONTENTS_SLIME | CONTENTS_LAVA);
634  water = qtrue;
635  } else {
636  //ZOID--added so rail goes through SOLID_BBOX entities (gibs, etc)
637  if ((tr.ent->svflags & SVF_MONSTER) || (tr.ent->client) ||
638  (tr.ent->solid == SOLID_BBOX))
639  ignore = tr.ent;
640  else
641  ignore = NULL;
642 
643  if ((tr.ent != self) && (tr.ent->takedamage))
644  T_Damage(tr.ent, self, self, aimdir, tr.endpos, tr.plane.normal, damage, kick, 0, MOD_RAILGUN);
645  }
646 
647  VectorCopy(tr.endpos, from);
648  }
649 
650  // send gun puff / flash
651  gi.WriteByte(svc_temp_entity);
652  gi.WriteByte(TE_RAILTRAIL);
653  gi.WritePosition(start);
654  gi.WritePosition(tr.endpos);
655  gi.multicast(self->s.origin, MULTICAST_PHS);
656 // gi.multicast (start, MULTICAST_PHS);
657  if (water) {
658  gi.WriteByte(svc_temp_entity);
659  gi.WriteByte(TE_RAILTRAIL);
660  gi.WritePosition(start);
661  gi.WritePosition(tr.endpos);
662  gi.multicast(tr.endpos, MULTICAST_PHS);
663  }
664 
665  if (self->client)
666  PlayerNoise(self, tr.endpos, PNOISE_IMPACT);
667 }

Referenced by monster_fire_railgun(), and weapon_railgun_fire().

◆ fire_rocket()

void fire_rocket ( edict_t *  self,
vec3_t  start,
vec3_t  dir,
int  damage,
int  speed,
float  damage_radius,
int  radius_damage 
)

Definition at line 577 of file g_weapon.c.

578 {
579  edict_t *rocket;
580 
581  rocket = G_Spawn();
582  VectorCopy(start, rocket->s.origin);
583  VectorCopy(dir, rocket->movedir);
584  vectoangles(dir, rocket->s.angles);
585  VectorScale(dir, speed, rocket->velocity);
586  rocket->movetype = MOVETYPE_FLYMISSILE;
587  rocket->clipmask = MASK_SHOT;
588  rocket->solid = SOLID_BBOX;
589  rocket->s.effects |= EF_ROCKET;
590  VectorClear(rocket->mins);
591  VectorClear(rocket->maxs);
592  rocket->s.modelindex = gi.modelindex("models/objects/rocket/tris.md2");
593  rocket->owner = self;
594  rocket->touch = rocket_touch;
595  rocket->nextthink = level.time + 8000 / speed;
596  rocket->think = G_FreeEdict;
597  rocket->dmg = damage;
598  rocket->radius_dmg = radius_damage;
599  rocket->dmg_radius = damage_radius;
600  rocket->s.sound = gi.soundindex("weapons/rockfly.wav");
601  rocket->classname = "rocket";
602 
603  if (self->client)
604  check_dodge(self, rocket->s.origin, dir, speed);
605 
606  gi.linkentity(rocket);
607 }

Referenced by monster_fire_rocket(), turret_breach_fire(), and Weapon_RocketLauncher_Fire().

◆ fire_shotgun()

void fire_shotgun ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  kick,
int  hspread,
int  vspread,
int  count,
int  mod 
)

Definition at line 268 of file g_weapon.c.

269 {
270  int i;
271 
272  for (i = 0; i < count; i++)
273  fire_lead(self, start, aimdir, damage, kick, TE_SHOTGUN, hspread, vspread, mod);
274 }

Referenced by monster_fire_shotgun(), weapon_shotgun_fire(), and weapon_supershotgun_fire().

◆ flymonster_start()

void flymonster_start ( edict_t *  self)

Definition at line 653 of file g_monster.c.

654 {
655  self->flags |= FL_FLY;
656  self->think = flymonster_start_go;
657  monster_start(self);
658 }

Referenced by SP_misc_insane(), SP_monster_boss2(), SP_monster_floater(), SP_monster_flyer(), and SP_monster_hover().

◆ FoundTarget()

void FoundTarget ( edict_t *  self)

Definition at line 328 of file g_ai.c.

329 {
330  // let other monsters see this monster for a while
331  if (self->enemy->client) {
332  level.sight_entity = self;
334  level.sight_entity->light_level = 128;
335  }
336 
337  self->show_hostile = level.time + 1; // wake up other monsters
338 
339  VectorCopy(self->enemy->s.origin, self->monsterinfo.last_sighting);
340  self->monsterinfo.trail_time = level.time;
341 
342  if (!self->combattarget) {
343  HuntTarget(self);
344  return;
345  }
346 
347  self->goalentity = self->movetarget = G_PickTarget(self->combattarget);
348  if (!self->movetarget) {
349  self->goalentity = self->movetarget = self->enemy;
350  HuntTarget(self);
351  gi.dprintf("%s at %s, combattarget %s not found\n", self->classname, vtos(self->s.origin), self->combattarget);
352  return;
353  }
354 
355  // clear out our combattarget, these are a one shot deal
356  self->combattarget = NULL;
357  self->monsterinfo.aiflags |= AI_COMBAT_POINT;
358 
359  // clear the targetname, that point is ours!
360  self->movetarget->targetname = NULL;
361  self->monsterinfo.pausetime = 0;
362 
363  // run for it
364  self->monsterinfo.run(self);
365 }

Referenced by FindTarget(), M_ReactToDamage(), medic_cable_attack(), medic_idle(), medic_run(), medic_search(), monster_triggered_spawn(), and monster_use().

◆ func_clock_think()

void func_clock_think ( edict_t *  self)

Definition at line 1600 of file g_misc.c.

1601 {
1602  if (!self->enemy) {
1603  self->enemy = G_Find(NULL, FOFS(targetname), self->target);
1604  if (!self->enemy)
1605  return;
1606  }
1607 
1608  if (self->spawnflags & 1) {
1610  self->health++;
1611  } else if (self->spawnflags & 2) {
1613  self->health--;
1614  } else {
1615  struct tm *ltime;
1616  time_t gmtime;
1617 
1618  gmtime = time(NULL);
1619  ltime = localtime(&gmtime);
1620  if (ltime)
1621  Q_snprintf(self->message, CLOCK_MESSAGE_SIZE, "%2i:%2i:%2i", ltime->tm_hour, ltime->tm_min, ltime->tm_sec);
1622  else
1623  strcpy(self->message, "00:00:00");
1624  if (self->message[3] == ' ')
1625  self->message[3] = '0';
1626  if (self->message[6] == ' ')
1627  self->message[6] = '0';
1628  }
1629 
1630  self->enemy->message = self->message;
1631  self->enemy->use(self->enemy, self, self);
1632 
1633  if (((self->spawnflags & 1) && (self->health > self->wait)) ||
1634  ((self->spawnflags & 2) && (self->health < self->wait))) {
1635  if (self->pathtarget) {
1636  char *savetarget;
1637  char *savemessage;
1638 
1639  savetarget = self->target;
1640  savemessage = self->message;
1641  self->target = self->pathtarget;
1642  self->message = NULL;
1643  G_UseTargets(self, self->activator);
1644  self->target = savetarget;
1645  self->message = savemessage;
1646  }
1647 
1648  if (!(self->spawnflags & 8))
1649  return;
1650 
1651  func_clock_reset(self);
1652 
1653  if (self->spawnflags & 4)
1654  return;
1655  }
1656 
1657  self->nextthink = level.time + 1;
1658 }

Referenced by ReadLevel(), and SP_func_clock().

◆ func_clock_use()

void func_clock_use ( edict_t *  self,
edict_t *  other,
edict_t *  activator 
)

Definition at line 1660 of file g_misc.c.

1661 {
1662  if (!(self->spawnflags & 8))
1663  self->use = NULL;
1664  if (self->activator)
1665  return;
1666  self->activator = activator;
1667  self->think(self);
1668 }

Referenced by ReadLevel(), and SP_func_clock().

◆ G_CheckChaseStats()

void G_CheckChaseStats ( edict_t *  ent)

Definition at line 485 of file p_hud.c.

486 {
487  int i;
488  gclient_t *cl;
489 
490  for (i = 1; i <= maxclients->value; i++) {
491  cl = g_edicts[i].client;
492  if (!g_edicts[i].inuse || cl->chase_target != ent)
493  continue;
494  memcpy(cl->ps.stats, ent->client->ps.stats, sizeof(cl->ps.stats));
496  }
497 }

Referenced by ClientEndServerFrame().

◆ G_CopyString()

char* G_CopyString ( char *  in)

Definition at line 362 of file g_utils.c.

363 {
364  char *out;
365 
366  out = gi.TagMalloc(strlen(in) + 1, TAG_LEVEL);
367  strcpy(out, in);
368  return out;
369 }

◆ G_Find()

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

Definition at line 43 of file g_utils.c.

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

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 *  e)

Definition at line 421 of file g_utils.c.

422 {
423  gi.unlinkentity(ed); // unlink from world
424 
425  if ((ed - g_edicts) <= (maxclients->value + BODY_QUEUE_SIZE)) {
426 // gi.dprintf("tried to free special edict\n");
427  return;
428  }
429 
430  memset(ed, 0, sizeof(*ed));
431  ed->classname = "freed";
432  ed->freetime = level.time;
433  ed->inuse = qfalse;
434 }

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(), flare_think(), 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 372 of file g_utils.c.

373 {
374  e->inuse = qtrue;
375  e->classname = "noclass";
376  e->gravity = 1.0;
377  e->s.number = e - g_edicts;
378 }

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

◆ G_PickTarget()

edict_t* G_PickTarget ( char *  targetname)

Definition at line 114 of file g_utils.c.

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

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 ( const vec3_t  point,
const vec3_t  distance,
const vec3_t  forward,
const vec3_t  right,
vec3_t  result 
)

◆ G_RunEntity()

void G_RunEntity ( edict_t *  ent)

Definition at line 905 of file g_phys.c.

906 {
907  if (ent->prethink)
908  ent->prethink(ent);
909 
910  switch ((int)ent->movetype) {
911  case MOVETYPE_PUSH:
912  case MOVETYPE_STOP:
913  SV_Physics_Pusher(ent);
914  break;
915  case MOVETYPE_NONE:
916  SV_Physics_None(ent);
917  break;
918  case MOVETYPE_NOCLIP:
919  SV_Physics_Noclip(ent);
920  break;
921  case MOVETYPE_STEP:
922  SV_Physics_Step(ent);
923  break;
924  case MOVETYPE_TOSS:
925  case MOVETYPE_BOUNCE:
926  case MOVETYPE_FLY:
927  case MOVETYPE_FLYMISSILE:
928  SV_Physics_Toss(ent);
929  break;
930  default:
931  gi.error("SV_Physics: bad movetype %i", (int)ent->movetype);
932  }
933 }

Referenced by G_RunFrame().

◆ G_SetMovedir()

void G_SetMovedir ( vec3_t  angles,
vec3_t  movedir 
)

Definition at line 296 of file g_utils.c.

297 {
298  if (VectorCompare(angles, VEC_UP)) {
299  VectorCopy(MOVEDIR_UP, movedir);
300  } else if (VectorCompare(angles, VEC_DOWN)) {
301  VectorCopy(MOVEDIR_DOWN, movedir);
302  } else {
303  AngleVectors(angles, movedir, NULL, NULL);
304  }
305 
306  VectorClear(angles);
307 }

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_SetSpectatorStats()

void G_SetSpectatorStats ( edict_t *  ent)

Definition at line 504 of file p_hud.c.

505 {
506  gclient_t *cl = ent->client;
507 
508  if (!cl->chase_target)
509  G_SetStats(ent);
510 
511  cl->ps.stats[STAT_SPECTATOR] = 1;
512 
513  // layouts are independant in spectator
514  cl->ps.stats[STAT_LAYOUTS] = 0;
515  if (cl->pers.health <= 0 || level.intermissiontime || cl->showscores)
516  cl->ps.stats[STAT_LAYOUTS] |= 1;
517  if (cl->showinventory && cl->pers.health > 0)
518  cl->ps.stats[STAT_LAYOUTS] |= 2;
519 
520  if (cl->chase_target && cl->chase_target->inuse)
521  cl->ps.stats[STAT_CHASE] = CS_PLAYERSKINS +
522  (cl->chase_target - g_edicts) - 1;
523  else
524  cl->ps.stats[STAT_CHASE] = 0;
525 }

Referenced by ClientEndServerFrame(), and G_CheckChaseStats().

◆ G_SetStats()

void G_SetStats ( edict_t *  ent)

Definition at line 353 of file p_hud.c.

354 {
355  gitem_t *item;
356  int index, cells;
357  int power_armor_type;
358 
359  //
360  // health
361  //
362  ent->client->ps.stats[STAT_HEALTH_ICON] = level.pic_health;
363  ent->client->ps.stats[STAT_HEALTH] = ent->health;
364 
365  //
366  // ammo
367  //
368  if (!ent->client->ammo_index /* || !ent->client->pers.inventory[ent->client->ammo_index] */) {
369  ent->client->ps.stats[STAT_AMMO_ICON] = 0;
370  ent->client->ps.stats[STAT_AMMO] = 0;
371  } else {
372  item = &itemlist[ent->client->ammo_index];
373  ent->client->ps.stats[STAT_AMMO_ICON] = gi.imageindex(item->icon);
374  ent->client->ps.stats[STAT_AMMO] = ent->client->pers.inventory[ent->client->ammo_index];
375  }
376 
377  //
378  // armor
379  //
380  power_armor_type = PowerArmorType(ent);
381  if (power_armor_type) {
382  cells = ent->client->pers.inventory[ITEM_INDEX(FindItem("cells"))];
383  if (cells == 0) {
384  // ran out of cells for power armor
385  ent->flags &= ~FL_POWER_ARMOR;
386  gi.sound(ent, CHAN_ITEM, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
387  power_armor_type = 0;;
388  }
389  }
390 
391  index = ArmorIndex(ent);
392  if (power_armor_type && (!index || (level.framenum & 8))) {
393  // flash between power armor and other armor icon
394  ent->client->ps.stats[STAT_ARMOR_ICON] = gi.imageindex("i_powershield");
395  ent->client->ps.stats[STAT_ARMOR] = cells;
396  } else if (index) {
397  item = GetItemByIndex(index);
398  ent->client->ps.stats[STAT_ARMOR_ICON] = gi.imageindex(item->icon);
399  ent->client->ps.stats[STAT_ARMOR] = ent->client->pers.inventory[index];
400  } else {
401  ent->client->ps.stats[STAT_ARMOR_ICON] = 0;
402  ent->client->ps.stats[STAT_ARMOR] = 0;
403  }
404 
405  //
406  // pickup message
407  //
408  if (level.time > ent->client->pickup_msg_time) {
409  ent->client->ps.stats[STAT_PICKUP_ICON] = 0;
410  ent->client->ps.stats[STAT_PICKUP_STRING] = 0;
411  }
412 
413  //
414  // timers
415  //
416  if (ent->client->quad_framenum > level.framenum) {
417  ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex("p_quad");
418  ent->client->ps.stats[STAT_TIMER] = (ent->client->quad_framenum - level.framenum) / 10;
419  } else if (ent->client->invincible_framenum > level.framenum) {
420  ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex("p_invulnerability");
421  ent->client->ps.stats[STAT_TIMER] = (ent->client->invincible_framenum - level.framenum) / 10;
422  } else if (ent->client->enviro_framenum > level.framenum) {
423  ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex("p_envirosuit");
424  ent->client->ps.stats[STAT_TIMER] = (ent->client->enviro_framenum - level.framenum) / 10;
425  } else if (ent->client->breather_framenum > level.framenum) {
426  ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex("p_rebreather");
427  ent->client->ps.stats[STAT_TIMER] = (ent->client->breather_framenum - level.framenum) / 10;
428  } else {
429  ent->client->ps.stats[STAT_TIMER_ICON] = 0;
430  ent->client->ps.stats[STAT_TIMER] = 0;
431  }
432 
433  //
434  // selected item
435  //
436  if (ent->client->pers.selected_item == -1)
437  ent->client->ps.stats[STAT_SELECTED_ICON] = 0;
438  else
439  ent->client->ps.stats[STAT_SELECTED_ICON] = gi.imageindex(itemlist[ent->client->pers.selected_item].icon);
440 
441  ent->client->ps.stats[STAT_SELECTED_ITEM] = ent->client->pers.selected_item;
442 
443  //
444  // layouts
445  //
446  ent->client->ps.stats[STAT_LAYOUTS] = 0;
447 
448  if (deathmatch->value) {
449  if (ent->client->pers.health <= 0 || level.intermissiontime
450  || ent->client->showscores)
451  ent->client->ps.stats[STAT_LAYOUTS] |= 1;
452  if (ent->client->showinventory && ent->client->pers.health > 0)
453  ent->client->ps.stats[STAT_LAYOUTS] |= 2;
454  } else {
455  if (ent->client->showscores || ent->client->showhelp)
456  ent->client->ps.stats[STAT_LAYOUTS] |= 1;
457  if (ent->client->showinventory && ent->client->pers.health > 0)
458  ent->client->ps.stats[STAT_LAYOUTS] |= 2;
459  }
460 
461  //
462  // frags
463  //
464  ent->client->ps.stats[STAT_FRAGS] = ent->client->resp.score;
465 
466  //
467  // help icon / current weapon if not shown
468  //
469  if (ent->client->pers.helpchanged && (level.framenum & 8))
470  ent->client->ps.stats[STAT_HELPICON] = gi.imageindex("i_help");
471  else if ((ent->client->pers.hand == CENTER_HANDED || ent->client->ps.fov > 91)
472  && ent->client->pers.weapon)
473  ent->client->ps.stats[STAT_HELPICON] = gi.imageindex(ent->client->pers.weapon->icon);
474  else
475  ent->client->ps.stats[STAT_HELPICON] = 0;
476 
477  ent->client->ps.stats[STAT_SPECTATOR] = 0;
478 }

Referenced by ClientEndServerFrame(), and G_SetSpectatorStats().

◆ G_Spawn()

edict_t* G_Spawn ( void  )

Definition at line 391 of file g_utils.c.

392 {
393  int i;
394  edict_t *e;
395 
396  e = &g_edicts[game.maxclients + 1];
397  for (i = game.maxclients + 1 ; i < globals.num_edicts ; i++, e++) {
398  // the first couple seconds of server time can involve a lot of
399  // freeing and allocating, so relax the replacement policy
400  if (!e->inuse && (e->freetime < 2 || level.time - e->freetime > 0.5)) {
401  G_InitEdict(e);
402  return e;
403  }
404  }
405 
406  if (i == game.maxentities)
407  gi.error("ED_Alloc: no free edicts");
408 
409  globals.num_edicts++;
410  G_InitEdict(e);
411  return e;
412 }

Referenced by ai_run(), Cmd_Give_f(), CreateTargetChangeLevel(), Drop_Item(), fire_bfg(), fire_blaster(), fire_flaregun(), 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 475 of file g_utils.c.

476 {
477  int i, num;
478  edict_t *touch[MAX_EDICTS], *hit;
479 
480  num = gi.BoxEdicts(ent->absmin, ent->absmax, touch
481  , MAX_EDICTS, AREA_SOLID);
482 
483  // be careful, it is possible to have an entity in this
484  // list removed before we get to it (killtriggered)
485  for (i = 0 ; i < num ; i++) {
486  hit = touch[i];
487  if (!hit->inuse)
488  continue;
489  if (ent->touch)
490  ent->touch(hit, ent, NULL, NULL);
491  if (!ent->inuse)
492  break;
493  }
494 }

◆ G_TouchTriggers()

void G_TouchTriggers ( edict_t *  ent)

Definition at line 443 of file g_utils.c.

444 {
445  int i, num;
446  edict_t *touch[MAX_EDICTS], *hit;
447 
448  // dead things don't activate triggers!
449  if ((ent->client || (ent->svflags & SVF_MONSTER)) && (ent->health <= 0))
450  return;
451 
452  num = gi.BoxEdicts(ent->absmin, ent->absmax, touch
453  , MAX_EDICTS, AREA_TRIGGERS);
454 
455  // be careful, it is possible to have an entity in this
456  // list removed before we get to it (killtriggered)
457  for (i = 0 ; i < num ; i++) {
458  hit = touch[i];
459  if (!hit->inuse)
460  continue;
461  if (!hit->touch)
462  continue;
463  hit->touch(hit, ent, NULL, NULL);
464  }
465 }

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 166 of file g_utils.c.

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

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().

◆ GetChaseTarget()

void GetChaseTarget ( edict_t *  ent)

Definition at line 155 of file g_chase.c.

156 {
157  int i;
158  edict_t *other;
159 
160  for (i = 1; i <= maxclients->value; i++) {
161  other = g_edicts + i;
162  if (other->inuse && !other->client->resp.spectator) {
163  ent->client->chase_target = other;
164  ent->client->update_chase = qtrue;
165  UpdateChaseCam(ent);
166  return;
167  }
168  }
169  gi.centerprintf(ent, "No other players to chase.");
170 }

Referenced by ClientThink().

◆ GetItemByIndex()

gitem_t* GetItemByIndex ( int  index)

Definition at line 61 of file g_items.c.

62 {
63  if (index == 0 || index >= game.num_items)
64  return NULL;
65 
66  return &itemlist[index];
67 }

Referenced by CheckArmor(), and G_SetStats().

◆ infront()

qboolean infront ( edict_t *  self,
edict_t *  other 
)

Definition at line 293 of file g_ai.c.

294 {
295  vec3_t vec;
296  float dot;
297  vec3_t forward;
298 
299  AngleVectors(self->s.angles, forward, NULL, NULL);
300  VectorSubtract(other->s.origin, self->s.origin, vec);
301  VectorNormalize(vec);
302  dot = DotProduct(vec, forward);
303 
304  if (dot > 0.3)
305  return qtrue;
306  return qfalse;
307 }

◆ InitBodyQue()

void InitBodyQue ( void  )

Definition at line 887 of file p_client.c.

888 {
889  int i;
890  edict_t *ent;
891 
892  level.body_que = 0;
893  for (i = 0; i < BODY_QUEUE_SIZE ; i++) {
894  ent = G_Spawn();
895  ent->classname = "bodyque";
896  }
897 }

Referenced by SP_worldspawn().

◆ InitClientPersistant()

void InitClientPersistant ( gclient_t *  client)

Definition at line 575 of file p_client.c.

576 {
577  gitem_t *item;
578 
579  memset(&client->pers, 0, sizeof(client->pers));
580 
581  item = FindItem("Blaster");
582  client->pers.selected_item = ITEM_INDEX(item);
583  client->pers.inventory[client->pers.selected_item] = 1;
584 
585  client->pers.weapon = item;
586 
587  if (sv_flaregun->integer > 0)
588  {
589  // Q2RTX: Spawn with a flare gun and some grenades to use with it.
590  // Flare gun is new and not found anywhere in the game as a pickup item.
591  gitem_t* item_flareg = FindItem("Flare Gun");
592  if (item_flareg)
593  {
594  client->pers.inventory[ITEM_INDEX(item_flareg)] = 1;
595 
596  if (sv_flaregun->integer == 2)
597  {
598  gitem_t* item_grenades = FindItem("Grenades");
599  client->pers.inventory[ITEM_INDEX(item_grenades)] = 5;
600  }
601  }
602  }
603 
604  client->pers.health = 100;
605  client->pers.max_health = 100;
606 
607  client->pers.max_bullets = 200;
608  client->pers.max_shells = 100;
609  client->pers.max_rockets = 50;
610  client->pers.max_grenades = 50;
611  client->pers.max_cells = 200;
612  client->pers.max_slugs = 50;
613 
614  client->pers.connected = qtrue;
615 }

Referenced by ClientConnect(), and PutClientInServer().

◆ InitClientResp()

void InitClientResp ( gclient_t *  client)

Definition at line 618 of file p_client.c.

619 {
620  memset(&client->resp, 0, sizeof(client->resp));
621  client->resp.enterframe = level.framenum;
622  client->resp.coop_respawn = client->pers;
623 }

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

◆ InitItems()

void InitItems ( void  )

Definition at line 2132 of file g_items.c.

2133 {
2134  game.num_items = sizeof(itemlist) / sizeof(itemlist[0]) - 1;
2135 }

Referenced by InitGame().

◆ KillBox()

qboolean KillBox ( edict_t *  ent)

Definition at line 515 of file g_utils.c.

516 {
517  trace_t tr;
518 
519  while (1) {
520  tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, ent->s.origin, NULL, MASK_PLAYERSOLID);
521  if (!tr.ent)
522  break;
523 
524  // nail it
525  T_Damage(tr.ent, ent, ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 0, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);
526 
527  // if we didn't kill it, fail
528  if (tr.ent->solid)
529  return qfalse;
530  }
531 
532  return qtrue; // all clear
533 }

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

◆ M_CatagorizePosition()

void M_CatagorizePosition ( edict_t *  ent)

Definition at line 178 of file g_monster.c.

179 {
180  vec3_t point;
181  int cont;
182 
183 //
184 // get waterlevel
185 //
186  point[0] = ent->s.origin[0];
187  point[1] = ent->s.origin[1];
188  point[2] = ent->s.origin[2] + ent->mins[2] + 1;
189  cont = gi.pointcontents(point);
190 
191  if (!(cont & MASK_WATER)) {
192  ent->waterlevel = 0;
193  ent->watertype = 0;
194  return;
195  }
196 
197  ent->watertype = cont;
198  ent->waterlevel = 1;
199  point[2] += 26;
200  cont = gi.pointcontents(point);
201  if (!(cont & MASK_WATER))
202  return;
203 
204  ent->waterlevel = 2;
205  point[2] += 22;
206  cont = gi.pointcontents(point);
207  if (cont & MASK_WATER)
208  ent->waterlevel = 3;
209 }

Referenced by M_droptofloor(), and monster_think().

◆ M_ChangeYaw()

void M_ChangeYaw ( edict_t *  ent)

Definition at line 279 of file m_move.c.

280 {
281  float ideal;
282  float current;
283  float move;
284  float speed;
285 
286  current = anglemod(ent->s.angles[YAW]);
287  ideal = ent->ideal_yaw;
288 
289  if (current == ideal)
290  return;
291 
292  move = ideal - current;
293  speed = ent->yaw_speed;
294  if (ideal > current) {
295  if (move >= 180)
296  move = move - 360;
297  } else {
298  if (move <= -180)
299  move = move + 360;
300  }
301  if (move > 0) {
302  if (move > speed)
303  move = speed;
304  } else {
305  if (move < -speed)
306  move = -speed;
307  }
308 
309  ent->s.angles[YAW] = anglemod(current + move);
310 }

Referenced by ai_charge(), ai_run_melee(), ai_run_missile(), ai_run_slide(), ai_stand(), ai_turn(), FindTarget(), and SV_StepDirection().

◆ M_CheckAttack()

qboolean M_CheckAttack ( edict_t *  self)

Definition at line 553 of file g_ai.c.

554 {
555  vec3_t spot1, spot2;
556  float chance;
557  trace_t tr;
558 
559  if (self->enemy->health > 0) {
560  // see if any entities are in the way of the shot
561  VectorCopy(self->s.origin, spot1);
562  spot1[2] += self->viewheight;
563  VectorCopy(self->enemy->s.origin, spot2);
564  spot2[2] += self->enemy->viewheight;
565 
566  tr = gi.trace(spot1, NULL, NULL, spot2, self, CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_SLIME | CONTENTS_LAVA | CONTENTS_WINDOW);
567 
568  // do we have a clear shot?
569  if (tr.ent != self->enemy)
570  return qfalse;
571  }
572 
573  // melee attack
574  if (enemy_range == RANGE_MELEE) {
575  // don't always melee in easy mode
576  if (skill->value == 0 && (rand() & 3))
577  return qfalse;
578  if (self->monsterinfo.melee)
579  self->monsterinfo.attack_state = AS_MELEE;
580  else
581  self->monsterinfo.attack_state = AS_MISSILE;
582  return qtrue;
583  }
584 
585 // missile attack
586  if (!self->monsterinfo.attack)
587  return qfalse;
588 
589  if (level.time < self->monsterinfo.attack_finished)
590  return qfalse;
591 
592  if (enemy_range == RANGE_FAR)
593  return qfalse;
594 
595  if (self->monsterinfo.aiflags & AI_STAND_GROUND) {
596  chance = 0.4;
597  } else if (enemy_range == RANGE_MELEE) {
598  chance = 0.2;
599  } else if (enemy_range == RANGE_NEAR) {
600  chance = 0.1;
601  } else if (enemy_range == RANGE_MID) {
602  chance = 0.02;
603  } else {
604  return qfalse;
605  }
606 
607  if (skill->value == 0)
608  chance *= 0.5;
609  else if (skill->value >= 2)
610  chance *= 2;
611 
612  if (random() < chance) {
613  self->monsterinfo.attack_state = AS_MISSILE;
614  self->monsterinfo.attack_finished = level.time + 2 * random();
615  return qtrue;
616  }
617 
618  if (self->flags & FL_FLY) {
619  if (random() < 0.3)
620  self->monsterinfo.attack_state = AS_SLIDING;
621  else
622  self->monsterinfo.attack_state = AS_STRAIGHT;
623  }
624 
625  return qfalse;
626 }

Referenced by medic_checkattack(), and monster_start().

◆ M_CheckBottom()

qboolean M_CheckBottom ( edict_t *  ent)

Definition at line 35 of file m_move.c.

36 {
37  vec3_t mins, maxs, start, stop;
38  trace_t trace;
39  int x, y;
40  float mid, bottom;
41 
42  VectorAdd(ent->s.origin, ent->mins, mins);
43  VectorAdd(ent->s.origin, ent->maxs, maxs);
44 
45 // if all of the points under the corners are solid world, don't bother
46 // with the tougher checks
47 // the corners must be within 16 of the midpoint
48  start[2] = mins[2] - 1;
49  for (x = 0 ; x <= 1 ; x++)
50  for (y = 0 ; y <= 1 ; y++) {
51  start[0] = x ? maxs[0] : mins[0];
52  start[1] = y ? maxs[1] : mins[1];
53  if (gi.pointcontents(start) != CONTENTS_SOLID)
54  goto realcheck;
55  }
56 
57  c_yes++;
58  return qtrue; // we got out easy
59 
60 realcheck:
61  c_no++;
62 //
63 // check it for real...
64 //
65  start[2] = mins[2];
66 
67 // the midpoint must be within 16 of the bottom
68  start[0] = stop[0] = (mins[0] + maxs[0]) * 0.5;
69  start[1] = stop[1] = (mins[1] + maxs[1]) * 0.5;
70  stop[2] = start[2] - 2 * STEPSIZE;
71  trace = gi.trace(start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
72 
73  if (trace.fraction == 1.0)
74  return qfalse;
75  mid = bottom = trace.endpos[2];
76 
77 // the corners must be within 16 of the midpoint
78  for (x = 0 ; x <= 1 ; x++)
79  for (y = 0 ; y <= 1 ; y++) {
80  start[0] = stop[0] = x ? maxs[0] : mins[0];
81  start[1] = stop[1] = y ? maxs[1] : mins[1];
82 
83  trace = gi.trace(start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
84 
85  if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
86  bottom = trace.endpos[2];
87  if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
88  return qfalse;
89  }
90 
91  c_yes++;
92  return qtrue;
93 }

Referenced by mutant_jump_touch(), SV_movestep(), SV_NewChaseDir(), and SV_Physics_Step().

◆ M_CheckGround()

void M_CheckGround ( edict_t *  ent)

Definition at line 139 of file g_monster.c.

140 {
141  vec3_t point;
142  trace_t trace;
143 
144  if (ent->flags & (FL_SWIM | FL_FLY))
145  return;
146 
147  if (ent->velocity[2] > 100) {
148  ent->groundentity = NULL;
149  return;
150  }
151 
152 // if the hull point one-quarter unit down is solid the entity is on ground
153  point[0] = ent->s.origin[0];
154  point[1] = ent->s.origin[1];
155  point[2] = ent->s.origin[2] - 0.25;
156 
157  trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, point, ent, MASK_MONSTERSOLID);
158 
159  // check steepness
160  if (trace.plane.normal[2] < 0.7 && !trace.startsolid) {
161  ent->groundentity = NULL;
162  return;
163  }
164 
165 // ent->groundentity = trace.ent;
166 // ent->groundentity_linkcount = trace.ent->linkcount;
167 // if (!trace.startsolid && !trace.allsolid)
168 // VectorCopy (trace.endpos, ent->s.origin);
169  if (!trace.startsolid && !trace.allsolid) {
170  VectorCopy(trace.endpos, ent->s.origin);
171  ent->groundentity = trace.ent;
172  ent->groundentity_linkcount = trace.ent->linkcount;
173  ent->velocity[2] = 0;
174  }
175 }

Referenced by G_RunFrame(), M_droptofloor(), monster_think(), and SV_Physics_Step().

◆ M_droptofloor()

void M_droptofloor ( edict_t *  ent)

Definition at line 286 of file g_monster.c.

287 {
288  vec3_t end;
289  trace_t trace;
290 
291  ent->s.origin[2] += 1;
292  VectorCopy(ent->s.origin, end);
293  end[2] -= 256;
294 
295  trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
296 
297  if (trace.fraction == 1 || trace.allsolid)
298  return;
299 
300  VectorCopy(trace.endpos, ent->s.origin);
301 
302  gi.linkentity(ent);
303  M_CheckGround(ent);
305 }

Referenced by SP_misc_explobox(), and walkmonster_start_go().

◆ M_FlyCheck()

void M_FlyCheck ( edict_t *  self)

Definition at line 121 of file g_monster.c.

122 {
123  if (self->waterlevel)
124  return;
125 
126  if (random() > 0.5)
127  return;
128 
129  self->think = M_FliesOn;
130  self->nextthink = level.time + 5 + 10 * random();
131 }

Referenced by infantry_dead(), and mutant_dead().

◆ M_MoveToGoal()

void M_MoveToGoal ( edict_t *  ent,
float  dist 
)

Definition at line 477 of file m_move.c.

478 {
479  edict_t *goal;
480 
481  goal = ent->goalentity;
482 
483  if (!ent->groundentity && !(ent->flags & (FL_FLY | FL_SWIM)))
484  return;
485 
486 // if the next step hits the enemy, return immediately
487  if (ent->enemy && SV_CloseEnough(ent, ent->enemy, dist))
488  return;
489 
490 // bump around...
491  if ((rand() & 3) == 1 || !SV_StepDirection(ent, ent->ideal_yaw, dist)) {
492  if (ent->inuse)
493  SV_NewChaseDir(ent, goal, dist);
494  }
495 }

Referenced by ai_run(), and ai_walk().

◆ M_walkmove()

qboolean M_walkmove ( edict_t *  ent,
float  yaw,
float  dist 
)

Definition at line 503 of file m_move.c.

504 {
505  vec3_t move;
506 
507  if (!ent->groundentity && !(ent->flags & (FL_FLY | FL_SWIM)))
508  return qfalse;
509 
510  yaw = yaw * M_PI * 2 / 360;
511 
512  move[0] = cos(yaw) * dist;
513  move[1] = sin(yaw) * dist;
514  move[2] = 0;
515 
516  return SV_movestep(ent, move, qtrue);
517 }

Referenced by ai_charge(), ai_move(), ai_run_slide(), ai_stand(), ai_turn(), barrel_touch(), flymonster_start_go(), and walkmonster_start_go().

◆ monster_death_use()

void monster_death_use ( edict_t *  self)

Definition at line 470 of file g_monster.c.

471 {
472  self->flags &= ~(FL_FLY | FL_SWIM);
473  self->monsterinfo.aiflags &= AI_GOOD_GUY;
474 
475  if (self->item) {
476  Drop_Item(self, self->item);
477  self->item = NULL;
478  }
479 
480  if (self->deathtarget)
481  self->target = self->deathtarget;
482 
483  if (!self->target)
484  return;
485 
486  G_UseTargets(self, self->enemy);
487 }

Referenced by Killed().

◆ monster_fire_bfg()

void monster_fire_bfg ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  speed,
int  kick,
float  damage_radius,
int  flashtype 
)

Definition at line 89 of file g_monster.c.

90 {
91  fire_bfg(self, start, aimdir, damage, speed, damage_radius);
92 
93  gi.WriteByte(svc_muzzleflash2);
94  gi.WriteShort(self - g_edicts);
95  gi.WriteByte(flashtype);
96  gi.multicast(start, MULTICAST_PVS);
97 }

Referenced by jorgBFG(), and makronBFG().

◆ monster_fire_blaster()

void monster_fire_blaster ( edict_t *  self,
vec3_t  start,
vec3_t  dir,
int  damage,
int  speed,
int  flashtype,
int  effect 
)

Definition at line 49 of file g_monster.c.

50 {
51  fire_blaster(self, start, dir, damage, speed, effect, qfalse);
52 
53  gi.WriteByte(svc_muzzleflash2);
54  gi.WriteShort(self - g_edicts);
55  gi.WriteByte(flashtype);
56  gi.multicast(start, MULTICAST_PVS);
57 }

Referenced by floater_fire_blaster(), flyer_fire(), hover_fire_blaster(), MakronHyperblaster(), medic_fire_blaster(), soldier_fire(), and TankBlaster().

◆ monster_fire_bullet()

void monster_fire_bullet ( edict_t *  self,
vec3_t  start,
vec3_t  dir,
int  damage,
int  kick,
int  hspread,
int  vspread,
int  flashtype 
)

Definition at line 29 of file g_monster.c.

30 {
31  fire_bullet(self, start, dir, damage, kick, hspread, vspread, MOD_UNKNOWN);
32 
33  gi.WriteByte(svc_muzzleflash2);
34  gi.WriteShort(self - g_edicts);
35  gi.WriteByte(flashtype);
36  gi.multicast(start, MULTICAST_PVS);
37 }

Referenced by actorMachineGun(), boss2_firebullet_left(), boss2_firebullet_right(), GunnerFire(), InfantryMachineGun(), jorg_firebullet_left(), jorg_firebullet_right(), soldier_fire(), supertankMachineGun(), and TankMachineGun().

◆ monster_fire_grenade()

void monster_fire_grenade ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  speed,
int  flashtype 
)

Definition at line 59 of file g_monster.c.

60 {
61  fire_grenade(self, start, aimdir, damage, speed, 2.5, damage + 40);
62 
63  gi.WriteByte(svc_muzzleflash2);
64  gi.WriteShort(self - g_edicts);
65  gi.WriteByte(flashtype);
66  gi.multicast(start, MULTICAST_PVS);
67 }

Referenced by GunnerGrenade().

◆ monster_fire_railgun()

void monster_fire_railgun ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  kick,
int  flashtype 
)

Definition at line 79 of file g_monster.c.

80 {
81  fire_rail(self, start, aimdir, damage, kick);
82 
83  gi.WriteByte(svc_muzzleflash2);
84  gi.WriteShort(self - g_edicts);
85  gi.WriteByte(flashtype);
86  gi.multicast(start, MULTICAST_PVS);
87 }

Referenced by GladiatorGun(), and MakronRailgun().

◆ monster_fire_rocket()

void monster_fire_rocket ( edict_t *  self,
vec3_t  start,
vec3_t  dir,
int  damage,
int  speed,
int  flashtype 
)

Definition at line 69 of file g_monster.c.

70 {
71  fire_rocket(self, start, dir, damage, speed, damage + 20, damage);
72 
73  gi.WriteByte(svc_muzzleflash2);
74  gi.WriteShort(self - g_edicts);
75  gi.WriteByte(flashtype);
76  gi.multicast(start, MULTICAST_PVS);
77 }

Referenced by Boss2Rocket(), ChickRocket(), supertankRocket(), and TankRocket().

◆ monster_fire_shotgun()

void monster_fire_shotgun ( edict_t *  self,
vec3_t  start,
vec3_t  aimdir,
int  damage,
int  kick,
int  hspread,
int  vspread,
int  count,
int  flashtype 
)

Definition at line 39 of file g_monster.c.

40 {
41  fire_shotgun(self, start, aimdir, damage, kick, hspread, vspread, count, MOD_UNKNOWN);
42 
43  gi.WriteByte(svc_muzzleflash2);
44  gi.WriteShort(self - g_edicts);
45  gi.WriteByte(flashtype);
46  gi.multicast(start, MULTICAST_PVS);
47 }

Referenced by soldier_fire().

◆ monster_think()

void monster_think ( edict_t *  self)

Definition at line 382 of file g_monster.c.

383 {
384  M_MoveFrame(self);
385  if (self->linkcount != self->monsterinfo.linkcount) {
386  self->monsterinfo.linkcount = self->linkcount;
387  M_CheckGround(self);
388  }
389  M_CatagorizePosition(self);
390  M_WorldEffects(self);
391  M_SetEffects(self);
392 }

Referenced by monster_start_go().

◆ MoveClientToIntermission()

void MoveClientToIntermission ( edict_t *  client)

Definition at line 30 of file p_hud.c.

31 {
32  if (deathmatch->value || coop->value)
33  ent->client->showscores = qtrue;
34  VectorCopy(level.intermission_origin, ent->s.origin);
35  ent->client->ps.pmove.origin[0] = level.intermission_origin[0] * 8;
36  ent->client->ps.pmove.origin[1] = level.intermission_origin[1] * 8;
37  ent->client->ps.pmove.origin[2] = level.intermission_origin[2] * 8;
38  VectorCopy(level.intermission_angle, ent->client->ps.viewangles);
39  ent->client->ps.pmove.pm_type = PM_FREEZE;
40  ent->client->ps.gunindex = 0;
41  ent->client->ps.blend[3] = 0;
42  ent->client->ps.rdflags &= ~RDF_UNDERWATER;
43 
44  // clean up powerup info
45  ent->client->quad_framenum = 0;
46  ent->client->invincible_framenum = 0;
47  ent->client->breather_framenum = 0;
48  ent->client->enviro_framenum = 0;
49  ent->client->grenade_blew_up = qfalse;
50  ent->client->grenade_time = 0;
51 
52  ent->viewheight = 0;
53  ent->s.modelindex = 0;
54  ent->s.modelindex2 = 0;
55  ent->s.modelindex3 = 0;
56  ent->s.modelindex = 0;
57  ent->s.effects = 0;
58  ent->s.sound = 0;
59  ent->solid = SOLID_NOT;
60 
61  // add the layout
62 
63  if (deathmatch->value || coop->value) {
64  DeathmatchScoreboardMessage(ent, NULL);
65  gi.unicast(ent, qtrue);
66  }
67 
68 }

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

◆ OnSameTeam()

qboolean OnSameTeam ( edict_t *  ent1,
edict_t *  ent2 
)

Definition at line 46 of file g_cmds.c.

47 {
48  char ent1Team [512];
49  char ent2Team [512];
50 
51  if (!((int)(dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS)))
52  return qfalse;
53 
54  strcpy(ent1Team, ClientTeam(ent1));
55  strcpy(ent2Team, ClientTeam(ent2));
56 
57  if (strcmp(ent1Team, ent2Team) == 0)
58  return qtrue;
59  return qfalse;
60 }

Referenced by Cmd_Say_f(), and T_Damage().

◆ player_die()

void player_die ( edict_t *  self,
edict_t *  inflictor,
edict_t *  attacker,
int  damage,
vec3_t  point 
)

Definition at line 476 of file p_client.c.

477 {
478  int n;
479 
480  VectorClear(self->avelocity);
481 
482  self->takedamage = DAMAGE_YES;
483  self->movetype = MOVETYPE_TOSS;
484 
485  self->s.modelindex2 = 0; // remove linked weapon model
486 
487  self->s.angles[0] = 0;
488  self->s.angles[2] = 0;
489 
490  self->s.sound = 0;
491  self->client->weapon_sound = 0;
492 
493  self->maxs[2] = -8;
494 
495 // self->solid = SOLID_NOT;
496  self->svflags |= SVF_DEADMONSTER;
497 
498  if (!self->deadflag) {
499  self->client->respawn_time = level.time + 1.0;
500  LookAtKiller(self, inflictor, attacker);
501  self->client->ps.pmove.pm_type = PM_DEAD;
502  ClientObituary(self, inflictor, attacker);
503  TossClientWeapon(self);
504  if (deathmatch->value)
505  Cmd_Help_f(self); // show scores
506 
507  // clear inventory
508  // this is kind of ugly, but it's how we want to handle keys in coop
509  for (n = 0; n < game.num_items; n++) {
510  if (coop->value && itemlist[n].flags & IT_KEY)
511  self->client->resp.coop_respawn.inventory[n] = self->client->pers.inventory[n];
512  self->client->pers.inventory[n] = 0;
513  }
514  }
515 
516  // remove powerups
517  self->client->quad_framenum = 0;
518  self->client->invincible_framenum = 0;
519  self->client->breather_framenum = 0;
520  self->client->enviro_framenum = 0;
521  self->flags &= ~FL_POWER_ARMOR;
522 
523  if (self->health < -40) {
524  // gib
525  gi.sound(self, CHAN_BODY, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
526  for (n = 0; n < 4; n++)
527  ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
528  ThrowClientHead(self, damage);
529 
530  self->takedamage = DAMAGE_NO;
531  } else {
532  // normal death
533  if (!self->deadflag) {
534  static int i;
535 
536  i = (i + 1) % 3;
537  // start a death animation
538  self->client->anim_priority = ANIM_DEATH;
539  if (self->client->ps.pmove.pm_flags & PMF_DUCKED) {
540  self->s.frame = FRAME_crdeath1 - 1;
541  self->client->anim_end = FRAME_crdeath5;
542  } else switch (i) {
543  case 0:
544  self->s.frame = FRAME_death101 - 1;
545  self->client->anim_end = FRAME_death106;
546  break;
547  case 1:
548  self->s.frame = FRAME_death201 - 1;
549  self->client->anim_end = FRAME_death206;
550  break;
551  case 2:
552  self->s.frame = FRAME_death301 - 1;
553  self->client->anim_end = FRAME_death308;
554  break;
555  }
556  gi.sound(self, CHAN_VOICE, gi.soundindex(va("*death%i.wav", (rand() % 4) + 1)), 1, ATTN_NORM, 0);
557  }
558  }
559 
560  self->deadflag = DEAD_DEAD;
561 
562  gi.linkentity(self);
563 }

Referenced by Cmd_Kill_f(), and PutClientInServer().

◆ player_pain()

void player_pain ( edict_t *  self,
edict_t *  other,
float  kick,
int  damage 
)

Definition at line 170 of file p_client.c.

171 {
172  // player pain is handled at the end of the frame in P_DamageFeedback
173 }

Referenced by PutClientInServer().

◆ PlayerNoise()

void PlayerNoise ( edict_t *  who,
vec3_t  where,
int  type 
)

Definition at line 56 of file p_weapon.c.

57 {
58  edict_t *noise;
59 
60  if (type == PNOISE_WEAPON) {
61  if (who->client->silencer_shots) {
62  who->client->silencer_shots--;
63  return;
64  }
65  }
66 
67  if (deathmatch->value)
68  return;
69 
70  if (who->flags & FL_NOTARGET)
71  return;
72 
73 
74  if (!who->mynoise) {
75  noise = G_Spawn();
76  noise->classname = "player_noise";
77  VectorSet(noise->mins, -8, -8, -8);
78  VectorSet(noise->maxs, 8, 8, 8);
79  noise->owner = who;
80  noise->svflags = SVF_NOCLIENT;
81  who->mynoise = noise;
82 
83  noise = G_Spawn();
84  noise->classname = "player_noise";
85  VectorSet(noise->mins, -8, -8, -8);
86  VectorSet(noise->maxs, 8, 8, 8);
87  noise->owner = who;
88  noise->svflags = SVF_NOCLIENT;
89  who->mynoise2 = noise;
90  }
91 
92  if (type == PNOISE_SELF || type == PNOISE_WEAPON) {
93  noise = who->mynoise;
94  level.sound_entity = noise;
96  } else { // type == PNOISE_IMPACT
97  noise = who->mynoise2;
98  level.sound2_entity = noise;
100  }
101 
102  VectorCopy(where, noise->s.origin);
103  VectorSubtract(where, noise->maxs, noise->absmin);
104  VectorAdd(where, noise->maxs, noise->absmax);
105  noise->teleport_time = level.time;
106  gi.linkentity(noise);
107 }

Referenced by bfg_touch(), Blaster_Fire(), blaster_touch(), Chaingun_Fire(), ClientThink(), fire_lead(), fire_rail(), Grenade_Explode(), Machinegun_Fire(), P_WorldEffects(), rocket_touch(), weapon_bfg_fire(), weapon_flaregun_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().

◆ PlayerTrail_Add()

void PlayerTrail_Add ( vec3_t  spot)

Definition at line 64 of file p_trail.c.

65 {
66  vec3_t temp;
67 
68  if (!trail_active)
69  return;
70 
71  VectorCopy(spot, trail[trail_head]->s.origin);
72 
73  trail[trail_head]->timestamp = level.time;
74 
75  VectorSubtract(spot, trail[PREV(trail_head)]->s.origin, temp);
76  trail[trail_head]->s.angles[1] = vectoyaw(temp);
77 
79 }

Referenced by ClientBeginServerFrame(), and PlayerTrail_New().

◆ PlayerTrail_Init()

void PlayerTrail_Init ( void  )

Definition at line 47 of file p_trail.c.

48 {
49  int n;
50 
51  if (deathmatch->value /* FIXME || coop */)
52  return;
53 
54  for (n = 0; n < TRAIL_LENGTH; n++) {
55  trail[n] = G_Spawn();
56  trail[n]->classname = "player_trail";
57  }
58 
59  trail_head = 0;
60  trail_active = qtrue;
61 }

Referenced by PlayerTrail_New(), and SpawnEntities().

◆ PlayerTrail_LastSpot()

edict_t* PlayerTrail_LastSpot ( void  )

Definition at line 136 of file p_trail.c.

137 {
138  return trail[PREV(trail_head)];
139 }

Referenced by ClientBeginServerFrame().

◆ PlayerTrail_New()

void PlayerTrail_New ( vec3_t  spot)

Definition at line 82 of file p_trail.c.

83 {
84  if (!trail_active)
85  return;
86 
88  PlayerTrail_Add(spot);
89 }

◆ PlayerTrail_PickFirst()

edict_t* PlayerTrail_PickFirst ( edict_t *  self)

Definition at line 92 of file p_trail.c.

93 {
94  int marker;
95  int n;
96 
97  if (!trail_active)
98  return NULL;
99 
100  for (marker = trail_head, n = TRAIL_LENGTH; n; n--) {
101  if (trail[marker]->timestamp <= self->monsterinfo.trail_time)
102  marker = NEXT(marker);
103  else
104  break;
105  }
106 
107  if (visible(self, trail[marker])) {
108  return trail[marker];
109  }
110 
111  if (visible(self, trail[PREV(marker)])) {
112  return trail[PREV(marker)];
113  }
114 
115  return trail[marker];
116 }

Referenced by ai_run().

◆ PlayerTrail_PickNext()

edict_t* PlayerTrail_PickNext ( edict_t *  self)

Definition at line 118 of file p_trail.c.

119 {
120  int marker;
121  int n;
122 
123  if (!trail_active)
124  return NULL;
125 
126  for (marker = trail_head, n = TRAIL_LENGTH; n; n--) {
127  if (trail[marker]->timestamp <= self->monsterinfo.trail_time)
128  marker = NEXT(marker);
129  else
130  break;
131  }
132 
133  return trail[marker];
134 }

Referenced by ai_run().

◆ PowerArmorType()

int PowerArmorType ( edict_t *  ent)

Definition at line 655 of file g_items.c.

656 {
657  if (!ent->client)
658  return POWER_ARMOR_NONE;
659 
660  if (!(ent->flags & FL_POWER_ARMOR))
661  return POWER_ARMOR_NONE;
662 
663  if (ent->client->pers.inventory[power_shield_index] > 0)
664  return POWER_ARMOR_SHIELD;
665 
666  if (ent->client->pers.inventory[power_screen_index] > 0)
667  return POWER_ARMOR_SCREEN;
668 
669  return POWER_ARMOR_NONE;
670 }

Referenced by CheckPowerArmor(), G_SetClientEffects(), and G_SetStats().

◆ PrecacheItem()

void PrecacheItem ( gitem_t it)

Definition at line 937 of file g_items.c.

938 {
939  char *s, *start;
940  char data[MAX_QPATH];
941  int len;
942  gitem_t *ammo;
943 
944  if (!it)
945  return;
946 
947  if (it->pickup_sound)
948  gi.soundindex(it->pickup_sound);
949  if (it->world_model)
950  gi.modelindex(it->world_model);
951  if (it->view_model)
952  gi.modelindex(it->view_model);
953  if (it->icon)
954  gi.imageindex(it->icon);
955 
956  // parse everything for its ammo
957  if (it->ammo && it->ammo[0]) {
958  ammo = FindItem(it->ammo);
959  if (ammo != it)
960  PrecacheItem(ammo);
961  }
962 
963  // parse the space seperated precache string for other items
964  s = it->precaches;
965  if (!s || !s[0])
966  return;
967 
968  while (*s) {
969  start = s;
970  while (*s && *s != ' ')
971  s++;
972 
973  len = s - start;
974  if (len >= MAX_QPATH || len < 5)
975  gi.error("PrecacheItem: %s has bad precache string", it->classname);
976  memcpy(data, start, len);
977  data[len] = 0;
978  if (*s)
979  s++;
980 
981  // determine type based on extension
982  if (!strcmp(data + len - 3, "md2"))
983  gi.modelindex(data);
984  else if (!strcmp(data + len - 3, "sp2"))
985  gi.modelindex(data);
986  else if (!strcmp(data + len - 3, "wav"))
987  gi.soundindex(data);
988  if (!strcmp(data + len - 3, "pcx"))
989  gi.imageindex(data);
990  }
991 }

Referenced by PrecacheItem(), SP_worldspawn(), and SpawnItem().

◆ PutClientInServer()

void PutClientInServer ( edict_t *  ent)

Definition at line 1073 of file p_client.c.

1074 {
1075  vec3_t mins = { -16, -16, -24};
1076  vec3_t maxs = {16, 16, 32};
1077  int index;
1078  vec3_t spawn_origin, spawn_angles;
1079  gclient_t *client;
1080  int i;
1082  client_respawn_t resp;
1083 
1084  // find a spawn point
1085  // do it before setting health back up, so farthest
1086  // ranging doesn't count this client
1087  SelectSpawnPoint(ent, spawn_origin, spawn_angles);
1088 
1089  index = ent - g_edicts - 1;
1090  client = ent->client;
1091 
1092  // deathmatch wipes most client data every spawn
1093  if (deathmatch->value) {
1094  char userinfo[MAX_INFO_STRING];
1095 
1096  resp = client->resp;
1097  memcpy(userinfo, client->pers.userinfo, sizeof(userinfo));
1098  InitClientPersistant(client);
1099  ClientUserinfoChanged(ent, userinfo);
1100  } else {
1101 // int n;
1102  char userinfo[MAX_INFO_STRING];
1103 
1104  resp = client->resp;
1105  memcpy(userinfo, client->pers.userinfo, sizeof(userinfo));
1106  // this is kind of ugly, but it's how we want to handle keys in coop
1107 // for (n = 0; n < game.num_items; n++)
1108 // {
1109 // if (itemlist[n].flags & IT_KEY)
1110 // resp.coop_respawn.inventory[n] = client->pers.inventory[n];
1111 // }
1112  resp.coop_respawn.game_helpchanged = client->pers.game_helpchanged;
1113  resp.coop_respawn.helpchanged = client->pers.helpchanged;
1114  client->pers = resp.coop_respawn;
1115  ClientUserinfoChanged(ent, userinfo);
1116  if (resp.score > client->pers.score)
1117  client->pers.score = resp.score;
1118  }
1119 
1120  // clear everything but the persistant data
1121  saved = client->pers;
1122  memset(client, 0, sizeof(*client));
1123  client->pers = saved;
1124  if (client->pers.health <= 0)
1125  InitClientPersistant(client);
1126  client->resp = resp;
1127 
1128  // copy some data from the client to the entity
1129  FetchClientEntData(ent);
1130 
1131  // clear entity values
1132  ent->groundentity = NULL;
1133  ent->client = &game.clients[index];
1134  ent->takedamage = DAMAGE_AIM;
1135  ent->movetype = MOVETYPE_WALK;
1136  ent->viewheight = 22;
1137  ent->inuse = qtrue;
1138  ent->classname = "player";
1139  ent->mass = 200;
1140  ent->solid = SOLID_BBOX;
1141  ent->deadflag = DEAD_NO;
1142  ent->air_finished = level.time + 12;
1143  ent->clipmask = MASK_PLAYERSOLID;
1144  ent->model = "players/male/tris.md2";
1145  ent->pain = player_pain;
1146  ent->die = player_die;
1147  ent->waterlevel = 0;
1148  ent->watertype = 0;
1149  ent->flags &= ~FL_NO_KNOCKBACK;
1150  ent->svflags &= ~SVF_DEADMONSTER;
1151 
1152  VectorCopy(mins, ent->mins);
1153  VectorCopy(maxs, ent->maxs);
1154  VectorClear(ent->velocity);
1155 
1156  // clear playerstate values
1157  memset(&ent->client->ps, 0, sizeof(client->ps));
1158 
1159  client->ps.pmove.origin[0] = spawn_origin[0] * 8;
1160  client->ps.pmove.origin[1] = spawn_origin[1] * 8;
1161  client->ps.pmove.origin[2] = spawn_origin[2] * 8;
1162 
1163  if (deathmatch->value && ((int)dmflags->value & DF_FIXED_FOV)) {
1164  client->ps.fov = 90;
1165  } else {
1166  client->ps.fov = atoi(Info_ValueForKey(client->pers.userinfo, "fov"));
1167  if (client->ps.fov < 1)
1168  client->ps.fov = 90;
1169  else if (client->ps.fov > 160)
1170  client->ps.fov = 160;
1171  }
1172 
1173  client->ps.gunindex = gi.modelindex(client->pers.weapon->view_model);
1174 
1175  // clear entity state values
1176  ent->s.effects = 0;
1177  ent->s.modelindex = 255; // will use the skin specified model
1178  ent->s.modelindex2 = 255; // custom gun model
1179  // sknum is player num and weapon number
1180  // weapon number will be added in changeweapon
1181  ent->s.skinnum = ent - g_edicts - 1;
1182 
1183  ent->s.frame = 0;
1184  VectorCopy(spawn_origin, ent->s.origin);
1185  ent->s.origin[2] += 1; // make sure off ground
1186  VectorCopy(ent->s.origin, ent->s.old_origin);
1187 
1188  // set the delta angle
1189  for (i = 0 ; i < 3 ; i++) {
1190  client->ps.pmove.delta_angles[i] = ANGLE2SHORT(spawn_angles[i] - client->resp.cmd_angles[i]);
1191  }
1192 
1193  ent->s.angles[PITCH] = 0;
1194  ent->s.angles[YAW] = spawn_angles[YAW];
1195  ent->s.angles[ROLL] = 0;
1196  VectorCopy(ent->s.angles, client->ps.viewangles);
1197  VectorCopy(ent->s.angles, client->v_angle);
1198 
1199  // spawn a spectator
1200  if (client->pers.spectator) {
1201  client->chase_target = NULL;
1202 
1203  client->resp.spectator = qtrue;
1204 
1205  ent->movetype = MOVETYPE_NOCLIP;
1206  ent->solid = SOLID_NOT;
1207  ent->svflags |= SVF_NOCLIENT;
1208  ent->client->ps.gunindex = 0;
1209  gi.linkentity(ent);
1210  return;
1211  } else
1212  client->resp.spectator = qfalse;
1213 
1214  if (!KillBox(ent)) {
1215  // could't spawn in?
1216  }
1217 
1218  gi.linkentity(ent);
1219 
1220  // force the current weapon up
1221  client->newweapon = client->pers.weapon;
1222  ChangeWeapon(ent);
1223 }

Referenced by ClientBegin(), ClientBeginDeathmatch(), respawn(), and spectator_respawn().

◆ range()

int range ( edict_t *  self,
edict_t *  other 
)

◆ respawn()

void respawn ( edict_t *  ent)

Definition at line 957 of file p_client.c.

958 {
959  if (deathmatch->value || coop->value) {
960  // spectator's don't leave bodies
961  if (self->movetype != MOVETYPE_NOCLIP)
962  CopyToBodyQue(self);
963  self->svflags &= ~SVF_NOCLIENT;
964  PutClientInServer(self);
965 
966  // add a teleportation effect
967  self->s.event = EV_PLAYER_TELEPORT;
968 
969  // hold in place briefly
970  self->client->ps.pmove.pm_flags = PMF_TIME_TELEPORT;
971  self->client->ps.pmove.pm_time = 14;
972 
973  self->client->respawn_time = level.time;
974 
975  return;
976  }
977 
978  // restart the entire server
979  gi.AddCommandString("pushmenu loadgame\n");
980 }

Referenced by BeginIntermission(), and ClientBeginServerFrame().

◆ SaveClientData()

void SaveClientData ( void  )

Definition at line 635 of file p_client.c.

636 {
637  int i;
638  edict_t *ent;
639 
640  for (i = 0 ; i < game.maxclients ; i++) {
641  ent = &g_edicts[1 + i];
642  if (!ent->inuse)
643  continue;
644  game.clients[i].pers.health = ent->health;
645  game.clients[i].pers.max_health = ent->max_health;
646  game.clients[i].pers.savedFlags = (ent->flags & (FL_GODMODE | FL_NOTARGET | FL_POWER_ARMOR));
647  if (coop->value)
648  game.clients[i].pers.score = ent->client->resp.score;
649  }
650 }

Referenced by SpawnEntities(), and WriteGame().

◆ ServerCommand()

void ServerCommand ( void  )

Definition at line 275 of file g_svcmds.c.

276 {
277  char *cmd;
278 
279  cmd = gi.argv(1);
280  if (Q_stricmp(cmd, "test") == 0)
281  Svcmd_Test_f();
282  else if (Q_stricmp(cmd, "addip") == 0)
283  SVCmd_AddIP_f();
284  else if (Q_stricmp(cmd, "removeip") == 0)
286  else if (Q_stricmp(cmd, "listip") == 0)
287  SVCmd_ListIP_f();
288  else if (Q_stricmp(cmd, "writeip") == 0)
289  SVCmd_WriteIP_f();
290  else
291  gi.cprintf(NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
292 }

Referenced by GetGameAPI().

◆ SetItemNames()

void SetItemNames ( void  )

Definition at line 2146 of file g_items.c.

2147 {
2148  int i;
2149  gitem_t *it;
2150 
2151  for (i = 0 ; i < game.num_items ; i++) {
2152  it = &itemlist[i];
2153  gi.configstring(CS_ITEMS + i, it->pickup_name);
2154  }
2155 
2156  jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor"));
2157  combat_armor_index = ITEM_INDEX(FindItem("Combat Armor"));
2158  body_armor_index = ITEM_INDEX(FindItem("Body Armor"));
2159  power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
2160  power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
2161 }

Referenced by SP_worldspawn().

◆ SetRespawn()

void SetRespawn ( edict_t *  ent,
float  delay 
)

Definition at line 142 of file g_items.c.

143 {
144  ent->flags |= FL_RESPAWN;
145  ent->svflags |= SVF_NOCLIENT;
146  ent->solid = SOLID_NOT;
147  ent->nextthink = level.time + delay;
148  ent->think = DoRespawn;
149  gi.linkentity(ent);
150 }

Referenced by MegaHealth_think(), Pickup_Adrenaline(), Pickup_Ammo(), Pickup_AncientHead(), Pickup_Armor(), Pickup_Bandolier(), Pickup_Health(), Pickup_Pack(), Pickup_PowerArmor(), Pickup_Powerup(), and Pickup_Weapon().

◆ SpawnItem()

void SpawnItem ( edict_t *  ent,
gitem_t item 
)

Definition at line 1003 of file g_items.c.

1004 {
1005  PrecacheItem(item);
1006 
1007  if (ent->spawnflags) {
1008  if (strcmp(ent->classname, "key_power_cube") != 0) {
1009  ent->spawnflags = 0;
1010  gi.dprintf("%s at %s has invalid spawnflags set\n", ent->classname, vtos(ent->s.origin));
1011  }
1012  }
1013 
1014  // some items will be prevented in deathmatch
1015  if (deathmatch->value) {
1016  if ((int)dmflags->value & DF_NO_ARMOR) {
1017  if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor) {
1018  G_FreeEdict(ent);
1019  return;
1020  }
1021  }
1022  if ((int)dmflags->value & DF_NO_ITEMS) {
1023  if (item->pickup == Pickup_Powerup) {
1024  G_FreeEdict(ent);
1025  return;
1026  }
1027  }
1028  if ((int)dmflags->value & DF_NO_HEALTH) {
1029  if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead) {
1030  G_FreeEdict(ent);
1031  return;
1032  }
1033  }
1034  if ((int)dmflags->value & DF_INFINITE_AMMO) {
1035  if ((item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0)) {
1036  G_FreeEdict(ent);
1037  return;
1038  }
1039  }
1040  }
1041 
1042  if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0)) {
1043  ent->spawnflags |= (1 << (8 + level.power_cubes));
1044  level.power_cubes++;
1045  }
1046 
1047  // don't let them drop items that stay in a coop game
1048  if ((coop->value) && (item->flags & IT_STAY_COOP)) {
1049  item->drop = NULL;
1050  }
1051 
1052  ent->item = item;
1053  ent->nextthink = level.time + 2 * FRAMETIME; // items start after other solids
1054  ent->think = droptofloor;
1055  ent->s.effects = item->world_model_flags;
1056  ent->s.renderfx = RF_GLOW;
1057  if (ent->model)
1058  gi.modelindex(ent->model);
1059 }

Referenced by Cmd_Give_f(), ED_CallSpawn(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), and SP_item_health_small().

◆ SV_FilterPacket()

qboolean SV_FilterPacket ( char *  from)

Definition at line 116 of file g_svcmds.c.

117 {
118  int i;
119  unsigned in;
120  byte m[4];
121  char *p;
122 
123  i = 0;
124  p = from;
125  while (*p && i < 4) {
126  m[i] = 0;
127  while (*p >= '0' && *p <= '9') {
128  m[i] = m[i] * 10 + (*p - '0');
129  p++;
130  }
131  if (!*p || *p == ':')
132  break;
133  i++, p++;
134  }
135 
136  in = *(unsigned *)m;
137 
138  for (i = 0 ; i < numipfilters ; i++)
139  if ((in & ipfilters[i].mask) == ipfilters[i].compare)
140  return (int)filterban->value;
141 
142  return (int)!filterban->value;
143 }

Referenced by ClientConnect().

◆ swimmonster_start()

void swimmonster_start ( edict_t *  self)

Definition at line 673 of file g_monster.c.

674 {
675  self->flags |= FL_SWIM;
676  self->think = swimmonster_start_go;
677  monster_start(self);
678 }

Referenced by SP_monster_flipper().

◆ 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 at line 358 of file g_combat.c.

359 {
360  gclient_t *client;
361  int take;
362  int save;
363  int asave;
364  int psave;
365  int te_sparks;
366 
367  if (!targ->takedamage)
368  return;
369 
370  // friendly fire avoidance
371  // if enabled you can't hurt teammates (but you can hurt yourself)
372  // knockback still occurs
373  if ((targ != attacker) && ((deathmatch->value && ((int)(dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS))) || coop->value)) {
374  if (OnSameTeam(targ, attacker)) {
375  if ((int)(dmflags->value) & DF_NO_FRIENDLY_FIRE)
376  damage = 0;
377  else
378  mod |= MOD_FRIENDLY_FIRE;
379  }
380  }
381  meansOfDeath = mod;
382 
383  // easy mode takes half damage
384  if (skill->value == 0 && deathmatch->value == 0 && targ->client) {
385  damage *= 0.5;
386  if (!damage)
387  damage = 1;
388  }
389 
390  client = targ->client;
391 
392  if (dflags & DAMAGE_BULLET)
393  te_sparks = TE_BULLET_SPARKS;
394  else
395  te_sparks = TE_SPARKS;
396 
397  VectorNormalize(dir);
398 
399 // bonus damage for suprising a monster
400  if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) && (attacker->client) && (!targ->enemy) && (targ->health > 0))
401  damage *= 2;
402 
403  if (targ->flags & FL_NO_KNOCKBACK)
404  knockback = 0;
405 
406 // figure momentum add
407  if (!(dflags & DAMAGE_NO_KNOCKBACK)) {
408  if ((knockback) && (targ->movetype != MOVETYPE_NONE) && (targ->movetype != MOVETYPE_BOUNCE) && (targ->movetype != MOVETYPE_PUSH) && (targ->movetype != MOVETYPE_STOP)) {
409  vec3_t kvel;
410  float mass;
411 
412  if (targ->mass < 50)
413  mass = 50;
414  else
415  mass = targ->mass;
416 
417  if (targ->client && attacker == targ)
418  VectorScale(dir, 1600.0 * (float)knockback / mass, kvel); // the rocket jump hack...
419  else
420  VectorScale(dir, 500.0 * (float)knockback / mass, kvel);
421 
422  VectorAdd(targ->velocity, kvel, targ->velocity);
423  }
424  }
425 
426  take = damage;
427  save = 0;
428 
429  // check for godmode
430  if ((targ->flags & FL_GODMODE) && !(dflags & DAMAGE_NO_PROTECTION)) {
431  take = 0;
432  save = damage;
433  SpawnDamage(te_sparks, point, normal, save);
434  }
435 
436  // check for invincibility
437  if ((client && client->invincible_framenum > level.framenum) && !(dflags & DAMAGE_NO_PROTECTION)) {
438  if (targ->pain_debounce_time < level.time) {
439  gi.sound(targ, CHAN_ITEM, gi.soundindex("items/protect4.wav"), 1, ATTN_NORM, 0);
440  targ->pain_debounce_time = level.time + 2;
441  }
442  take = 0;
443  save = damage;
444  }
445 
446  psave = CheckPowerArmor(targ, point, normal, take, dflags);
447  take -= psave;
448 
449  asave = CheckArmor(targ, point, normal, take, te_sparks, dflags);
450  take -= asave;
451 
452  //treat cheat/powerup savings the same as armor
453  asave += save;
454 
455  // team damage avoidance
456  if (!(dflags & DAMAGE_NO_PROTECTION) && CheckTeamDamage(targ, attacker))
457  return;
458 
459 // do the damage
460  if (take) {
461  if ((targ->svflags & SVF_MONSTER) || (client))
462  {
463  // SpawnDamage(TE_BLOOD, point, normal, take);
464  SpawnDamage(TE_BLOOD, point, dir, take);
465  }
466  else
467  SpawnDamage(te_sparks, point, normal, take);
468 
469 
470  targ->health = targ->health - take;
471 
472  if (targ->health <= 0) {
473  if ((targ->svflags & SVF_MONSTER) || (client))
474  targ->flags |= FL_NO_KNOCKBACK;
475  Killed(targ, inflictor, attacker, take, point);
476  return;
477  }
478  }
479 
480  if (targ->svflags & SVF_MONSTER) {
481  M_ReactToDamage(targ, attacker);
482  if (!(targ->monsterinfo.aiflags & AI_DUCKED) && (take)) {
483  targ->pain(targ, attacker, knockback, take);
484  // nightmare mode monsters don't go into pain frames often
485  if (skill->value == 3)
486  targ->pain_debounce_time = level.time + 5;
487  }
488  } else if (client) {
489  if (!(targ->flags & FL_GODMODE) && (take))
490  targ->pain(targ, attacker, knockback, take);
491  } else if (take) {
492  if (targ->pain)
493  targ->pain(targ, attacker, knockback, take);
494  }
495 
496  // add to the damage inflicted on a player this frame
497  // the total will be turned into screen blends and view angle kicks
498  // at the end of the frame
499  if (client) {
500  client->damage_parmor += psave;
501  client->damage_armor += asave;
502  client->damage_blood += take;
503  client->damage_knockback += knockback;
504  VectorCopy(point, client->damage_from);
505  }
506 }

Referenced by bfg_explode(), bfg_think(), bfg_touch(), blaster_touch(), door_blocked(), door_secret_blocked(), fire_hit(), fire_lead(), fire_rail(), floater_zap(), func_object_touch(), Grenade_Explode(), hurt_touch(), KillBox(), M_WorldEffects(), mutant_jump_touch(), P_FallingDamage(), P_WorldEffects(), parasite_drain_attack(), plat_blocked(), rocket_touch(), rotating_blocked(), rotating_touch(), T_RadiusDamage(), target_laser_think(), train_blocked(), turret_blocked(), and use_target_changelevel().

◆ T_RadiusDamage()

void T_RadiusDamage ( edict_t *  inflictor,
edict_t *  attacker,
float  damage,
edict_t *  ignore,
float  radius,
int  mod 
)

Definition at line 514 of file g_combat.c.

515 {
516  float points;
517  edict_t *ent = NULL;
518  vec3_t v;
519  vec3_t dir;
520 
521  while ((ent = findradius(ent, inflictor->s.origin, radius)) != NULL) {
522  if (ent == ignore)
523  continue;
524  if (!ent->takedamage)
525  continue;
526 
527  VectorAdd(ent->mins, ent->maxs, v);
528  VectorMA(ent->s.origin, 0.5, v, v);
529  VectorSubtract(inflictor->s.origin, v, v);
530  points = damage - 0.5 * VectorLength(v);
531  if (ent == attacker)
532  points = points * 0.5;
533  if (points > 0) {
534  if (CanDamage(ent, inflictor)) {
535  VectorSubtract(ent->s.origin, inflictor->s.origin, dir);
536  T_Damage(ent, inflictor, attacker, dir, inflictor->s.origin, vec3_origin, (int)points, (int)points, DAMAGE_RADIUS, mod);
537  }
538  }
539  }
540 }

Referenced by barrel_explode(), bfg_touch(), func_explosive_explode(), Grenade_Explode(), misc_viper_bomb_touch(), rocket_touch(), target_explosion_explode(), and use_target_splash().

◆ Think_Weapon()

void Think_Weapon ( edict_t *  ent)

Definition at line 260 of file p_weapon.c.

261 {
262  // if just died, put the weapon away
263  if (ent->health < 1) {
264  ent->client->newweapon = NULL;
265  ChangeWeapon(ent);
266  }
267 
268  // call active weapon think routine
269  if (ent->client->pers.weapon && ent->client->pers.weapon->weaponthink) {
270  is_quad = (ent->client->quad_framenum > level.framenum);
271  if (ent->client->silencer_shots)
272  is_silenced = MZ_SILENCED;
273  else
274  is_silenced = 0;
275  ent->client->pers.weapon->weaponthink(ent);
276  }
277 }

Referenced by ClientBeginServerFrame(), and ClientThink().

◆ ThrowClientHead()

void ThrowClientHead ( edict_t *  self,
int  damage 
)

Definition at line 218 of file g_misc.c.

219 {
220  vec3_t vd;
221  char *gibname;
222 
223  if (rand() & 1) {
224  gibname = "models/objects/gibs/head2/tris.md2";
225  self->s.skinnum = 1; // second skin is player
226  } else {
227  gibname = "models/objects/gibs/skull/tris.md2";
228  self->s.skinnum = 0;
229  }
230 
231  self->s.origin[2] += 32;
232  self->s.frame = 0;
233  gi.setmodel(self, gibname);
234  VectorSet(self->mins, -16, -16, 0);
235  VectorSet(self->maxs, 16, 16, 16);
236 
237  self->takedamage = DAMAGE_NO;
238  self->solid = SOLID_NOT;
239  self->s.effects = EF_GIB;
240  self->s.sound = 0;
241  self->flags |= FL_NO_KNOCKBACK;
242 
243  self->movetype = MOVETYPE_BOUNCE;
244  VelocityForDamage(damage, vd);
245  VectorAdd(self->velocity, vd, self->velocity);
246 
247  if (self->client) { // bodies in the queue don't have a client anymore
248  self->client->anim_priority = ANIM_DEATH;
249  self->client->anim_end = self->s.frame;
250  } else {
251  self->think = NULL;
252  self->nextthink = 0;
253  }
254 
255  gi.linkentity(self);
256 }

Referenced by body_die(), and player_die().

◆ ThrowDebris()

void ThrowDebris ( edict_t *  self,
char *  modelname,
float  speed,
vec3_t  origin 
)

Definition at line 269 of file g_misc.c.

270 {
271  edict_t *chunk;
272  vec3_t v;
273 
274  chunk = G_Spawn();
275  VectorCopy(origin, chunk->s.origin);
276  gi.setmodel(chunk, modelname);
277  v[0] = 100 * crandom();
278  v[1] = 100 * crandom();
279  v[2] = 100 + 100 * crandom();
280  VectorMA(self->velocity, speed, v, chunk->velocity);
281  chunk->movetype = MOVETYPE_BOUNCE;
282  chunk->solid = SOLID_NOT;
283  chunk->avelocity[0] = random() * 600;
284  chunk->avelocity[1] = random() * 600;
285  chunk->avelocity[2] = random() * 600;
286  chunk->think = G_FreeEdict;
287  chunk->nextthink = level.time + 5 + random() * 5;
288  chunk->s.frame = 0;
289  chunk->flags = 0;
290  chunk->classname = "debris";
291  chunk->takedamage = DAMAGE_YES;
292  chunk->die = debris_die;
293  gi.linkentity(chunk);
294 }

Referenced by barrel_explode(), func_explosive_explode(), and rocket_touch().

◆ ThrowGib()

void ThrowGib ( edict_t *  self,
char *  gibname,
int  damage,
int  type 
)

Definition at line 130 of file g_misc.c.

131 {
132  edict_t *gib;
133  vec3_t vd;
134  vec3_t origin;
135  vec3_t size;
136  float vscale;
137 
138  gib = G_Spawn();
139 
140  VectorScale(self->size, 0.5, size);
141  VectorAdd(self->absmin, size, origin);
142  gib->s.origin[0] = origin[0] + crandom() * size[0];
143  gib->s.origin[1] = origin[1] + crandom() * size[1];
144  gib->s.origin[2] = origin[2] + crandom() * size[2];
145 
146  gi.setmodel(gib, gibname);
147  gib->solid = SOLID_NOT;
148  gib->s.effects |= EF_GIB;
149  gib->flags |= FL_NO_KNOCKBACK;
150  gib->takedamage = DAMAGE_YES;
151  gib->die = gib_die;
152 
153  if (type == GIB_ORGANIC) {
154  gib->movetype = MOVETYPE_TOSS;
155  gib->touch = gib_touch;
156  vscale = 0.5;
157  } else {
158  gib->movetype = MOVETYPE_BOUNCE;
159  vscale = 1.0;
160  }
161 
162  VelocityForDamage(damage, vd);
163  VectorMA(self->velocity, vscale, vd, gib->velocity);
164  ClipGibVelocity(gib);
165  gib->avelocity[0] = random() * 600;
166  gib->avelocity[1] = random() * 600;
167  gib->avelocity[2] = random() * 600;
168 
169  gib->think = G_FreeEdict;
170  gib->nextthink = level.time + 10 + random() * 10;
171 
172  gi.linkentity(gib);
173 }

Referenced by actor_die(), berserk_die(), body_die(), boss2_die(), BossExplode(), brain_die(), chick_die(), flipper_die(), gladiator_die(), gunner_die(), hover_die(), infantry_die(), insane_die(), makron_die(), medic_die(), misc_deadsoldier_die(), mutant_die(), parasite_die(), player_die(), soldier_die(), and tank_die().

◆ ThrowHead()

void ThrowHead ( edict_t *  self,
char *  gibname,
int  damage,
int  type 
)

Definition at line 175 of file g_misc.c.

176 {
177  vec3_t vd;
178  float vscale;
179 
180  self->s.skinnum = 0;
181  self->s.frame = 0;
182  VectorClear(self->mins);
183  VectorClear(self->maxs);
184 
185  self->s.modelindex2 = 0;
186  gi.setmodel(self, gibname);
187  self->solid = SOLID_NOT;
188  self->s.effects |= EF_GIB;
189  self->s.effects &= ~EF_FLIES;
190  self->s.sound = 0;
191  self->flags |= FL_NO_KNOCKBACK;
192  self->svflags &= ~SVF_MONSTER;
193  self->takedamage = DAMAGE_YES;
194  self->die = gib_die;
195 
196  if (type == GIB_ORGANIC) {
197  self->movetype = MOVETYPE_TOSS;
198  self->touch = gib_touch;
199  vscale = 0.5;
200  } else {
201  self->movetype = MOVETYPE_BOUNCE;
202  vscale = 1.0;
203  }
204 
205  VelocityForDamage(damage, vd);
206  VectorMA(self->velocity, vscale, vd, self->velocity);
207  ClipGibVelocity(self);
208 
209  self->avelocity[YAW] = crandom() * 600;
210 
211  self->think = G_FreeEdict;
212  self->nextthink = level.time + 10 + random() * 10;
213 
214  gi.linkentity(self);
215 }

Referenced by actor_die(), berserk_die(), boss2_die(), BossExplode(), brain_die(), chick_die(), flipper_die(), gladiator_die(), gunner_die(), hover_die(), infantry_die(), insane_die(), makron_die(), medic_die(), misc_deadsoldier_die(), mutant_die(), parasite_die(), soldier_die(), and tank_die().

◆ Touch_Item()

void Touch_Item ( edict_t *  ent,
edict_t *  other,
cplane_t *  plane,
csurface_t *  surf 
)

Definition at line 723 of file g_items.c.

724 {
725  qboolean taken;
726 
727  if (!other->client)
728  return;
729  if (other->health < 1)
730  return; // dead people can't pickup
731  if (!ent->item->pickup)
732  return; // not a grabbable item?
733 
734  taken = ent->item->pickup(ent, other);
735 
736  if (taken) {
737  // flash the screen
738  other->client->bonus_alpha = 0.25;
739 
740  // show icon and name on status bar
741  other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
742  other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(ent->item);
743  other->client->pickup_msg_time = level.time + 3.0;
744 
745  // change selected item
746  if (ent->item->use)
747  other->client->pers.selected_item = other->client->ps.stats[STAT_SELECTED_ITEM] = ITEM_INDEX(ent->item);
748 
749  if (ent->item->pickup == Pickup_Health) {
750  if (ent->count == 2)
751  gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0);
752  else if (ent->count == 10)
753  gi.sound(other, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
754  else if (ent->count == 25)
755  gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0);
756  else // (ent->count == 100)
757  gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0);
758  } else if (ent->item->pickup_sound) {
759  gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
760  }
761  }
762 
763  if (!(ent->spawnflags & ITEM_TARGETS_USED)) {
764  G_UseTargets(ent, other);
765  ent->spawnflags |= ITEM_TARGETS_USED;
766  }
767 
768  if (!taken)
769  return;
770 
771  if (!((coop->value) && (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM))) {
772  if (ent->flags & FL_RESPAWN)
773  ent->flags &= ~FL_RESPAWN;
774  else
775  G_FreeEdict(ent);
776  }
777 }

◆ tv()

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

Definition at line 248 of file g_utils.c.

249 {
250  static int index;
251  static vec3_t vecs[8];
252  float *v;
253 
254  // use an array so that multiple tempvectors won't collide
255  // for a while
256  v = vecs[index];
257  index = (index + 1) & 7;
258 
259  v[0] = x;
260  v[1] = y;
261  v[2] = z;
262 
263  return v;
264 }

Referenced by droptofloor(), NET_Sleep(), and os_select().

◆ UpdateChaseCam()

void UpdateChaseCam ( edict_t *  ent)

Definition at line 20 of file g_chase.c.

21 {
22  vec3_t o, ownerv, goal;
23  edict_t *targ;
24  vec3_t forward, right;
25  trace_t trace;
26  int i;
27  vec3_t angles;
28 
29  // is our chase target gone?
30  if (!ent->client->chase_target->inuse
31  || ent->client->chase_target->client->resp.spectator) {
32  edict_t *old = ent->client->chase_target;
33  ChaseNext(ent);
34  if (ent->client->chase_target == old) {
35  ent->client->chase_target = NULL;
36  ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
37  return;
38  }
39  }
40 
41  targ = ent->client->chase_target;
42 
43  VectorCopy(targ->s.origin, ownerv);
44 
45  ownerv[2] += targ->viewheight;
46 
47  VectorCopy(targ->client->v_angle, angles);
48  if (angles[PITCH] > 56)
49  angles[PITCH] = 56;
50  AngleVectors(angles, forward, right, NULL);
52  VectorMA(ownerv, -30, forward, o);
53 
54  if (o[2] < targ->s.origin[2] + 20)
55  o[2] = targ->s.origin[2] + 20;
56 
57  // jump animation lifts
58  if (!targ->groundentity)
59  o[2] += 16;
60 
61  trace = gi.trace(ownerv, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
62 
63  VectorCopy(trace.endpos, goal);
64 
65  VectorMA(goal, 2, forward, goal);
66 
67  // pad for floors and ceilings
68  VectorCopy(goal, o);
69  o[2] += 6;
70  trace = gi.trace(goal, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
71  if (trace.fraction < 1) {
72  VectorCopy(trace.endpos, goal);
73  goal[2] -= 6;
74  }
75 
76  VectorCopy(goal, o);
77  o[2] -= 6;
78  trace = gi.trace(goal, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
79  if (trace.fraction < 1) {
80  VectorCopy(trace.endpos, goal);
81  goal[2] += 6;
82  }
83 
84  if (targ->deadflag)
85  ent->client->ps.pmove.pm_type = PM_DEAD;
86  else
87  ent->client->ps.pmove.pm_type = PM_FREEZE;
88 
89  VectorCopy(goal, ent->s.origin);
90  for (i = 0 ; i < 3 ; i++)
91  ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(targ->client->v_angle[i] - ent->client->resp.cmd_angles[i]);
92 
93  if (targ->deadflag) {
94  ent->client->ps.viewangles[ROLL] = 40;
95  ent->client->ps.viewangles[PITCH] = -15;
96  ent->client->ps.viewangles[YAW] = targ->client->killer_yaw;
97  } else {
98  VectorCopy(targ->client->v_angle, ent->client->ps.viewangles);
99  VectorCopy(targ->client->v_angle, ent->client->v_angle);
100  }
101 
102  ent->viewheight = 0;
103  ent->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
104  gi.linkentity(ent);
105 }

Referenced by ClientThink(), and GetChaseTarget().

◆ ValidateSelectedItem()

void ValidateSelectedItem ( edict_t *  ent)

Definition at line 125 of file g_cmds.c.

126 {
127  gclient_t *cl;
128 
129  cl = ent->client;
130 
131  if (cl->pers.inventory[cl->pers.selected_item])
132  return; // valid
133 
134  SelectNextItem(ent, -1);
135 }

Referenced by Cmd_InvDrop_f(), Cmd_InvUse_f(), Drop_Ammo(), Drop_General(), Use_Breather(), Use_Envirosuit(), Use_Invulnerability(), Use_Quad(), and Use_Silencer().

◆ vectoangles()

void vectoangles ( vec3_t  vec,
vec3_t  angles 
)

Definition at line 330 of file g_utils.c.

331 {
332  float forward;
333  float yaw, pitch;
334 
335  if (value1[1] == 0 && value1[0] == 0) {
336  yaw = 0;
337  if (value1[2] > 0)
338  pitch = 90;
339  else
340  pitch = 270;
341  } else {
342  if (value1[0])
343  yaw = (int)(atan2(value1[1], value1[0]) * 180 / M_PI);
344  else if (value1[1] > 0)
345  yaw = 90;
346  else
347  yaw = -90;
348  if (yaw < 0)
349  yaw += 360;
350 
351  forward = sqrt(value1[0] * value1[0] + value1[1] * value1[1]);
352  pitch = (int)(atan2(value1[2], forward) * 180 / M_PI);
353  if (pitch < 0)
354  pitch += 360;
355  }
356 
357  angles[PITCH] = -pitch;
358  angles[YAW] = yaw;
359  angles[ROLL] = 0;
360 }

Referenced by fire_bfg(), fire_blaster(), fire_flaregun(), fire_grenade(), fire_grenade2(), fire_lead(), fire_rocket(), flare_sparks(), 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 310 of file g_utils.c.

311 {
312  float yaw;
313 
314  if (/*vec[YAW] == 0 &&*/ vec[PITCH] == 0) {
315  yaw = 0;
316  if (vec[YAW] > 0)
317  yaw = 90;
318  else if (vec[YAW] < 0)
319  yaw = -90;
320  } else {
321  yaw = (int)(atan2(vec[YAW], vec[PITCH]) * 180 / M_PI);
322  if (yaw < 0)
323  yaw += 360;
324  }
325 
326  return yaw;
327 }

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().

◆ visible()

qboolean visible ( edict_t *  self,
edict_t *  other 
)

Definition at line 268 of file g_ai.c.

269 {
270  vec3_t spot1;
271  vec3_t spot2;
272  trace_t trace;
273 
274  VectorCopy(self->s.origin, spot1);
275  spot1[2] += self->viewheight;
276  VectorCopy(other->s.origin, spot2);
277  spot2[2] += other->viewheight;
278  trace = gi.trace(spot1, vec3_origin, vec3_origin, spot2, self, MASK_OPAQUE);
279 
280  if (trace.fraction == 1.0)
281  return qtrue;
282  return qfalse;
283 }

◆ vtos()

char* vtos ( vec3_t  v)

Definition at line 275 of file g_utils.c.

276 {
277  static int index;
278  static char str[8][32];
279  char *s;
280 
281  // use an array so that multiple vtos won't collide
282  s = str[index];
283  index = (index + 1) & 7;
284 
285  Q_snprintf(s, 32, "(%i %i %i)", (int)v[0], (int)v[1], (int)v[2]);
286 
287  return s;
288 }

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().

◆ walkmonster_start()

Variable Documentation

◆ bob_pitch

cvar_t* bob_pitch

Definition at line 63 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_roll

cvar_t* bob_roll

Definition at line 64 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ bob_up

cvar_t* bob_up

Definition at line 62 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ coop

◆ deathmatch

cvar_t* deathmatch

Definition at line 33 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

◆ dmflags

◆ filterban

cvar_t* filterban

Definition at line 49 of file g_main.c.

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

◆ flood_msgs

cvar_t* flood_msgs

Definition at line 68 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_persecond

cvar_t* flood_persecond

Definition at line 69 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ flood_waitdelay

cvar_t* flood_waitdelay

Definition at line 70 of file g_main.c.

Referenced by Cmd_Say_f(), and InitGame().

◆ fraglimit

cvar_t* fraglimit

Definition at line 37 of file g_main.c.

Referenced by CheckDMRules(), and InitGame().

◆ g_edicts

◆ g_select_empty

cvar_t* g_select_empty

Definition at line 45 of file g_main.c.

Referenced by InitGame(), and Use_Weapon().

◆ game

◆ gi

game_import_t gi

Definition at line 23 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_Error(), Com_LPrintf(), 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_flaregun(), fire_grenade(), fire_grenade2(), fire_hit(), fire_lead(), fire_rail(), fire_rocket(), flare_sparks(), 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(), read_data(), read_field(), read_index(), read_pointer(), read_string(), read_zstring(), 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(), 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_flaregun_fire(), Weapon_Generic(), Weapon_Grenade(), weapon_grenadelauncher_fire(), Weapon_HyperBlaster_Fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), weapon_supershotgun_fire(), write_data(), write_field(), write_index(), write_pointer(), WriteGame(), and WriteLevel().

◆ globals

◆ gun_x

cvar_t* gun_x

Definition at line 56 of file g_main.c.

Referenced by InitGame(), and SV_CalcGunOffset().

◆ gun_y

cvar_t * gun_y

Definition at line 526 of file g_local.h.

Referenced by SV_CalcGunOffset().

◆ gun_z

cvar_t * gun_z

Definition at line 526 of file g_local.h.

Referenced by SV_CalcGunOffset().

◆ itemlist

◆ level

Definition at line 22 of file g_main.c.

Referenced by actor_attack(), actor_fire(), actor_pain(), actor_run(), actor_stand(), ai_checkattack(), ai_run(), AI_SetSightClient(), ai_stand(), ai_walk(), AngleMove_Begin(), AngleMove_Calc(), AngleMove_Final(), AttackFinished(), barrel_delay(), BeginIntermission(), berserk_pain(), bfg_explode(), bfg_think(), bfg_touch(), Boss2_CheckAttack(), boss2_pain(), BossExplode(), brain_dodge(), brain_duck_hold(), brain_pain(), buddy_allocator_allocate(), buddy_allocator_free(), button_wait(), Chaingun_Fire(), ChangeWeapon(), CheckDMRules(), CheckPowerArmor(), chick_duck_down(), chick_duck_hold(), chick_pain(), CL_ParsePrint(), ClientBegin(), ClientBeginDeathmatch(), ClientBeginServerFrame(), ClientCommand(), ClientEndServerFrame(), ClientThink(), Cmd_Kill_f(), Cmd_PlayerList_f(), Cmd_Say_f(), commander_body_think(), commander_body_use(), CopyToBodyQue(), CreateTargetChangeLevel(), DeathmatchScoreboardMessage(), door_go_up(), door_hit_top(), door_secret_blocked(), door_secret_move1(), door_secret_move3(), door_secret_move5(), door_touch(), Drop_Item(), drop_make_touchable(), droptofloor(), EndDMLevel(), ExitLevel(), FindTarget(), finish_download(), fire_bfg(), fire_blaster(), fire_flaregun(), fire_grenade(), fire_grenade2(), fire_rocket(), flare_sparks(), flare_think(), flipper_pain(), floater_pain(), flyer_pain(), FoundTarget(), func_clock_think(), func_timer_think(), func_timer_use(), func_train_find(), G_FreeEdict(), G_RunFrame(), G_SetClientEffects(), G_SetClientSound(), G_SetSpectatorStats(), G_SetStats(), G_Spawn(), G_UseTargets(), get_level_offset(), gib_think(), gib_touch(), gladiator_pain(), gunner_duck_down(), gunner_duck_hold(), gunner_pain(), HelpComputer(), hover_dead(), hover_deadthink(), hover_pain(), hurt_touch(), infantry_cock_gun(), infantry_duck_down(), infantry_duck_hold(), infantry_fire(), infantry_pain(), InitBodyQue(), InitClientResp(), insane_pain(), Jorg_CheckAttack(), jorg_pain(), Killed(), M_CheckAttack(), M_FliesOn(), M_FlyCheck(), M_MoveFrame(), M_SetEffects(), M_WorldEffects(), Machinegun_Fire(), Makron_CheckAttack(), makron_pain(), makron_torso(), makron_torso_think(), MakronSpawn(), MakronToss(), medic_cable_attack(), medic_duck_down(), medic_duck_hold(), medic_pain(), MegaHealth_think(), merge_blocks(), misc_banner_think(), misc_blackhole_think(), misc_easterchick2_think(), misc_easterchick_think(), misc_eastertank_think(), misc_satellite_dish_think(), misc_satellite_dish_use(), misc_viper_bomb_prethink(), misc_viper_bomb_use(), monster_start(), monster_start_go(), monster_triggered_spawn(), monster_triggered_spawn_use(), Move_Begin(), Move_Calc(), Move_Final(), MoveClientToIntermission(), multi_trigger(), mutant_check_landing(), mutant_jump_takeoff(), mutant_pain(), MVD_BroadcastPrintf(), MVD_ParsePrint(), MVD_UnicastPrint(), os_getsockopt(), os_setsockopt(), P_DamageFeedback(), P_FallingDamage(), P_WorldEffects(), parasite_pain(), path_corner_touch(), PF_bprintf(), PF_cprintf(), Pickup_Health(), Pickup_Powerup(), plat_hit_top(), player_die(), PlayerNoise(), PlayerTrail_Add(), point_combat_touch(), PutClientInServer(), ReadLevel(), remove_block_from_free_list(), respawn(), S_Activate(), SetRespawn(), soldier_attack3_refire(), soldier_dodge(), soldier_duck_down(), soldier_duck_hold(), soldier_fire(), soldier_pain(), SP_CreateCoopSpots(), SP_func_clock(), SP_func_door(), SP_func_door_rotating(), SP_func_object(), SP_func_timer(), SP_func_train(), SP_info_player_coop(), SP_info_player_start(), SP_misc_banner(), SP_misc_blackhole(), 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_strogg_ship(), SP_misc_viper(), SP_monster_boss3_stand(), SP_monster_commander_body(), SP_monster_flyer(), SP_target_changelevel(), SP_target_crosslevel_target(), SP_target_goal(), SP_target_laser(), SP_target_secret(), SP_trigger_elevator(), SP_turret_breach(), SP_turret_driver(), SP_viewthing(), SP_worldspawn(), SpawnEntities(), SpawnItem(), spectator_respawn(), supertank_pain(), SV_BroadcastPrintf(), SV_CalcBlend(), SV_CalcViewOffset(), SV_ClientPrintf(), SV_MvdBroadcastPrint(), SV_RunThink(), T_Damage(), tank_attack(), tank_pain(), target_actor_touch(), target_earthquake_think(), target_earthquake_use(), target_laser_think(), target_lightramp_think(), target_lightramp_use(), TH_viewthing(), Think_AccelMove(), Think_Boss3Stand(), Think_Weapon(), ThrowDebris(), ThrowGib(), ThrowHead(), TossClientWeapon(), Touch_DoorTrigger(), Touch_Item(), Touch_Plat_Center(), train_blocked(), train_wait(), trigger_key_use(), trigger_push_touch(), turret_breach_think(), turret_driver_link(), turret_driver_think(), Use_Breather(), Use_Envirosuit(), Use_Invulnerability(), Use_Quad(), use_target_changelevel(), use_target_explosion(), use_target_goal(), use_target_secret(), walkmonster_start_go(), weapon_bfg_fire(), Weapon_Generic(), Weapon_Grenade(), weapon_grenade_fire(), Weapon_HyperBlaster_Fire(), write_free_block_to_list(), and WriteLevel().

◆ maxclients

cvar_t* maxclients

Definition at line 42 of file g_main.c.

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

◆ maxentities

cvar_t* maxentities

Definition at line 44 of file g_main.c.

Referenced by InitGame().

◆ maxspectators

cvar_t* maxspectators

Definition at line 43 of file g_main.c.

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

◆ meansOfDeath

int meansOfDeath

Definition at line 29 of file g_main.c.

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

◆ needpass

cvar_t* needpass

Definition at line 41 of file g_main.c.

Referenced by InitGame().

◆ nomonsters

cvar_t* nomonsters

Definition at line 47 of file g_main.c.

Referenced by InitGame(), and SpawnEntities().

◆ password

cvar_t* password

◆ run_pitch

cvar_t* run_pitch

Definition at line 60 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ run_roll

cvar_t* run_roll

Definition at line 61 of file g_main.c.

Referenced by InitGame(), and SV_CalcViewOffset().

◆ skill

◆ sm_meat_index

int sm_meat_index

Definition at line 27 of file g_main.c.

Referenced by gib_touch(), and SP_worldspawn().

◆ snd_fry

int snd_fry

Definition at line 28 of file g_main.c.

Referenced by G_SetClientSound(), and SP_worldspawn().

◆ spectator_password

cvar_t* spectator_password

Definition at line 40 of file g_main.c.

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

◆ st

◆ sv_cheats

cvar_t* sv_cheats

Definition at line 66 of file g_main.c.

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

◆ sv_features

cvar_t* sv_features

Definition at line 74 of file g_main.c.

Referenced by InitGame().

◆ sv_flaregun

cvar_t* sv_flaregun

Definition at line 76 of file g_main.c.

Referenced by InitClientPersistant(), and InitGame().

◆ sv_gravity

cvar_t* sv_gravity

Definition at line 52 of file g_main.c.

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

◆ sv_maplist

cvar_t* sv_maplist

Definition at line 72 of file g_main.c.

Referenced by EndDMLevel(), and InitGame().

◆ sv_maxvelocity

cvar_t* sv_maxvelocity

Definition at line 51 of file g_main.c.

Referenced by InitGame(), and SV_CheckVelocity().

◆ sv_rollangle

cvar_t* sv_rollangle

Definition at line 55 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ sv_rollspeed

cvar_t* sv_rollspeed

Definition at line 54 of file g_main.c.

Referenced by InitGame(), and SV_CalcRoll().

◆ timelimit

cvar_t* timelimit

Definition at line 38 of file g_main.c.

Referenced by CheckDMRules(), and InitGame().

FindItem
gitem_t * FindItem(char *pickup_name)
Definition: g_items.c:98
gi
game_import_t gi
Definition: g_main.c:23
UpdateChaseCam
void UpdateChaseCam(edict_t *ent)
Definition: g_chase.c:20
Cmd_Score_f
void Cmd_Score_f(edict_t *ent)
Definition: p_hud.c:255
IT_AMMO
#define IT_AMMO
Definition: g_local.h:212
SV_CloseEnough
qboolean SV_CloseEnough(edict_t *ent, edict_t *goal, float dist)
Definition: m_move.c:458
level_locals_t::pic_health
int pic_health
Definition: g_local.h:321
spectator_respawn
void spectator_respawn(edict_t *ent)
Definition: p_client.c:986
G_SetSpectatorStats
void G_SetSpectatorStats(edict_t *ent)
Definition: p_hud.c:504
RANGE_NEAR
#define RANGE_NEAR
Definition: g_local.h:117
FRAME_death201
#define FRAME_death201
Definition: m_actor.h:33
deathmatch
cvar_t * deathmatch
Definition: g_main.c:33
F_FUNCTION
@ F_FUNCTION
Definition: g_local.h:579
client_state_s::inventory
int inventory[MAX_ITEMS]
Definition: client.h:270
G_ProjectSource
void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result)
Definition: g_utils.c:23
Pickup_Armor
qboolean Pickup_Armor(edict_t *ent, edict_t *other)
Definition: g_items.c:580
DEAD_DEAD
#define DEAD_DEAD
Definition: g_local.h:112
AMMO_ROCKETS
@ AMMO_ROCKETS
Definition: g_local.h:102
AI_COMBAT_POINT
#define AI_COMBAT_POINT
Definition: g_local.h:138
FRAME_pain301
#define FRAME_pain301
Definition: m_actor.h:102
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:391
c_no
int c_no
Definition: m_move.c:33
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:43
ThrowGib
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
Definition: g_misc.c:130
MELEE_DISTANCE
#define MELEE_DISTANCE
Definition: g_local.h:82
AI_TEMP_STAND_GROUND
#define AI_TEMP_STAND_GROUND
Definition: g_local.h:127
FRAME_crpain1
#define FRAME_crpain1
Definition: m_player.h:191
ANIM_DEATH
#define ANIM_DEATH
Definition: g_local.h:816
F_IGNORE
@ F_IGNORE
Definition: g_local.h:581
AI_GOOD_GUY
#define AI_GOOD_GUY
Definition: g_local.h:134
PlayerTrail_PickNext
edict_t * PlayerTrail_PickNext(edict_t *self)
Definition: p_trail.c:118
WEAPON_DROPPING
@ WEAPON_DROPPING
Definition: g_local.h:95
Think_Delay
void Think_Delay(edict_t *ent)
Definition: g_utils.c:144
maxclients
cvar_t * maxclients
Definition: g_main.c:42
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
AMMO_BULLETS
@ AMMO_BULLETS
Definition: g_local.h:100
gitem_s::precaches
char * precaches
Definition: g_local.h:257
F_ZSTRING
@ F_ZSTRING
Definition: g_local.h:573
level_locals_t::sight_client
edict_t * sight_client
Definition: g_local.h:312
BODY_QUEUE_SIZE
#define BODY_QUEUE_SIZE
Definition: g_local.h:84
level_locals_t::body_que
int body_que
Definition: g_local.h:333
monster_start
qboolean monster_start(edict_t *self)
Definition: g_monster.c:492
PNOISE_WEAPON
#define PNOISE_WEAPON
Definition: g_local.h:180
FRAMETIME
#define FRAMETIME
Definition: g_local.h:75
client_persistant_t::helpchanged
int helpchanged
Definition: g_local.h:852
DeathmatchScoreboard
void DeathmatchScoreboard(edict_t *ent)
Definition: p_hud.c:241
WEAPON_READY
@ WEAPON_READY
Definition: g_local.h:93
ITEM_TARGETS_USED
#define ITEM_TARGETS_USED
Definition: g_local.h:559
AMMO_SHELLS
@ AMMO_SHELLS
Definition: g_local.h:101
fire_rail
void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
Definition: g_weapon.c:615
F_VECTOR
@ F_VECTOR
Definition: g_local.h:574
M_SetEffects
void M_SetEffects(edict_t *ent)
Definition: g_monster.c:308
bobfracsin
float bobfracsin
Definition: p_view.c:32
PowerArmorType
int PowerArmorType(edict_t *ent)
Definition: g_items.c:655
M_walkmove
qboolean M_walkmove(edict_t *ent, float yaw, float dist)
Definition: m_move.c:503
ai_checkattack
qboolean ai_checkattack(edict_t *self, float dist)
Definition: g_ai.c:702
MOVETYPE_NOCLIP
@ MOVETYPE_NOCLIP
Definition: g_local.h:187
F_BYTE
@ F_BYTE
Definition: g_local.h:567
MOVETYPE_STOP
@ MOVETYPE_STOP
Definition: g_local.h:189
FRAME_crdeath5
#define FRAME_crdeath5
Definition: m_player.h:199
combat_armor_index
static int combat_armor_index
Definition: g_items.c:43
ipfilter_t::compare
unsigned compare
Definition: g_svcmds.c:60
MOVEDIR_UP
vec3_t MOVEDIR_UP
Definition: g_utils.c:292
game_locals_t::helpchanged
int helpchanged
Definition: g_local.h:270
client_respawn_t::coop_respawn
client_persistant_t coop_respawn
Definition: g_local.h:859
G_SetClientSound
void G_SetClientSound(edict_t *ent)
Definition: p_view.c:761
AI_LOST_SIGHT
#define AI_LOST_SIGHT
Definition: g_local.h:129
fire_rocket
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
Definition: g_weapon.c:577
gitem_s::pickup
qboolean(* pickup)(struct edict_s *ent, struct edict_s *other)
Definition: g_local.h:234
FRAME_pain304
#define FRAME_pain304
Definition: m_boss31.h:112
FRAME_death101
#define FRAME_death101
Definition: m_actor.h:26
ITEM_INDEX
#define ITEM_INDEX(x)
Definition: g_local.h:600
saved
qboolean saved
Definition: ogg.c:69
FL_POWER_ARMOR
#define FL_POWER_ARMOR
Definition: g_local.h:71
AI_STAND_GROUND
#define AI_STAND_GROUND
Definition: g_local.h:126
weapon_grenade_fire
void weapon_grenade_fire(edict_t *ent, qboolean held)
Definition: p_weapon.c:485
gitem_s::world_model_flags
int world_model_flags
Definition: g_local.h:240
SV_Physics_Noclip
void SV_Physics_Noclip(edict_t *ent)
Definition: g_phys.c:626
DAMAGE_RADIUS
#define DAMAGE_RADIUS
Definition: g_local.h:647
fire_bfg
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
Definition: g_weapon.c:830
svc_muzzleflash2
#define svc_muzzleflash2
Definition: g_local.h:37
walkmonster_start_go
void walkmonster_start_go(edict_t *self)
Definition: g_monster.c:610
check_dodge
static void check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed)
Definition: g_weapon.c:30
MOVETYPE_PUSH
@ MOVETYPE_PUSH
Definition: g_local.h:188
MOVETYPE_FLYMISSILE
@ MOVETYPE_FLYMISSILE
Definition: g_local.h:195
MOD_RAILGUN
#define MOD_RAILGUN
Definition: g_local.h:468
MOD_TELEFRAG
#define MOD_TELEFRAG
Definition: g_local.h:478
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:43
PlayerTrail_Add
void PlayerTrail_Add(vec3_t spot)
Definition: p_trail.c:64
Pickup_Health
qboolean Pickup_Health(edict_t *ent, edict_t *other)
Definition: g_items.c:533
DAMAGE_YES
@ DAMAGE_YES
Definition: g_local.h:88
Think_Weapon
void Think_Weapon(edict_t *ent)
Definition: p_weapon.c:260
FOFS
#define FOFS(x)
Definition: g_local.h:498
ClientUserinfoChanged
void ClientUserinfoChanged(edict_t *ent, char *userinfo)
Definition: p_client.c:1325
M_CheckGround
void M_CheckGround(edict_t *ent)
Definition: g_monster.c:139
Grenade_Touch
void Grenade_Touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_weapon.c:424
DoRespawn
void DoRespawn(edict_t *ent)
Definition: g_items.c:116
FL_NO_KNOCKBACK
#define FL_NO_KNOCKBACK
Definition: g_local.h:70
level_locals_t::power_cubes
int power_cubes
Definition: g_local.h:335
vectoyaw
float vectoyaw(vec3_t vec)
Definition: g_utils.c:310
Pickup_PowerArmor
qboolean Pickup_PowerArmor(edict_t *ent, edict_t *other)
Definition: g_items.c:690
TAG_LEVEL
#define TAG_LEVEL
Definition: g_local.h:79
fire_grenade
void fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
Definition: g_weapon.c:450
WEAPON_ACTIVATING
@ WEAPON_ACTIVATING
Definition: g_local.h:94
AI_PURSUE_TEMP
#define AI_PURSUE_TEMP
Definition: g_local.h:132
bfg_touch
void bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_weapon.c:717
F_ITEM
@ F_ITEM
Definition: g_local.h:577
flymonster_start_go
void flymonster_start_go(edict_t *self)
Definition: g_monster.c:637
SV_Physics_Pusher
void SV_Physics_Pusher(edict_t *ent)
Definition: g_phys.c:551
meansOfDeath
int meansOfDeath
Definition: g_main.c:29
ammo_t
ammo_t
Definition: g_local.h:99
body_armor_index
static int body_armor_index
Definition: g_items.c:44
ArmorIndex
int ArmorIndex(edict_t *ent)
Definition: g_items.c:563
FRAME_death301
#define FRAME_death301
Definition: m_actor.h:46
g_edicts
edict_t * g_edicts
Definition: g_main.c:31
rocket_touch
void rocket_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_weapon.c:532
F_EDICT
@ F_EDICT
Definition: g_local.h:576
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:358
other
@ other
Definition: ogg.c:63
TossClientWeapon
void TossClientWeapon(edict_t *self)
Definition: p_client.c:392
Grenade_Explode
void Grenade_Explode(edict_t *ent)
Definition: g_weapon.c:371
weaponstate_t
weaponstate_t
Definition: g_local.h:92
itemlist
gitem_t itemlist[]
Definition: g_items.c:1063
PrecacheItem
void PrecacheItem(gitem_t *it)
Definition: g_items.c:937
MOVETYPE_STEP
@ MOVETYPE_STEP
Definition: g_local.h:192
DAMAGE_NO_KNOCKBACK
#define DAMAGE_NO_KNOCKBACK
Definition: g_local.h:650
CopyToBodyQue
void CopyToBodyQue(edict_t *ent)
Definition: p_client.c:913
gitem_s::icon
char * icon
Definition: g_local.h:244
HuntTarget
void HuntTarget(edict_t *self)
Definition: g_ai.c:312
level_locals_t::sight_entity_framenum
int sight_entity_framenum
Definition: g_local.h:315
FL_SWIM
#define FL_SWIM
Definition: g_local.h:60
F_FLOAT
@ F_FLOAT
Definition: g_local.h:570
IT_KEY
#define IT_KEY
Definition: g_local.h:215
drop_make_touchable
void drop_make_touchable(edict_t *ent)
Definition: g_items.c:789
MoveClientToIntermission
void MoveClientToIntermission(edict_t *ent)
Definition: p_hud.c:30
SVCmd_ListIP_f
void SVCmd_ListIP_f(void)
Definition: g_svcmds.c:210
debris_die
void debris_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: g_misc.c:264
ANIM_PAIN
#define ANIM_PAIN
Definition: g_local.h:814
level_locals_t::intermission_origin
vec3_t intermission_origin
Definition: g_local.h:309
SV_CalcGunOffset
void SV_CalcGunOffset(edict_t *ent)
Definition: p_view.c:332
client_respawn_t::score
int score
Definition: g_local.h:861
G_SetStats
void G_SetStats(edict_t *ent)
Definition: p_hud.c:353
jacket_armor_index
static int jacket_armor_index
Definition: g_items.c:42
POWER_ARMOR_SHIELD
#define POWER_ARMOR_SHIELD
Definition: g_local.h:158
POWER_ARMOR_SCREEN
#define POWER_ARMOR_SCREEN
Definition: g_local.h:157
vec3_origin
vec3_t vec3_origin
Definition: shared.c:21
DAMAGE_BULLET
#define DAMAGE_BULLET
Definition: g_local.h:651
Pickup_Adrenaline
qboolean Pickup_Adrenaline(edict_t *ent, edict_t *other)
Definition: g_items.c:191
DAMAGE_NO_PROTECTION
#define DAMAGE_NO_PROTECTION
Definition: g_local.h:652
vectoangles
void vectoangles(vec3_t vec, vec3_t angles)
Definition: g_utils.c:330
gib_touch
void gib_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_misc.c:101
G_SetClientEffects
void G_SetClientEffects(edict_t *ent)
Definition: p_view.c:699
VEC_DOWN
vec3_t VEC_DOWN
Definition: g_utils.c:293
gitem_s::world_model
char * world_model
Definition: g_local.h:239
findradius
edict_t * findradius(edict_t *from, vec3_t org, float rad)
Definition: g_utils.c:75
FL_RESPAWN
#define FL_RESPAWN
Definition: g_local.h:72
xyspeed
float xyspeed
Definition: p_view.c:28
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:421
M_MoveFrame
void M_MoveFrame(edict_t *self)
Definition: g_monster.c:332
SV_CalcRoll
float SV_CalcRoll(vec3_t angles, vec3_t velocity)
Definition: p_view.c:40
movetype_t
movetype_t
Definition: g_local.h:185
MOVETYPE_NONE
@ MOVETYPE_NONE
Definition: g_local.h:186
F_CLIENT
@ F_CLIENT
Definition: g_local.h:578
CLOCK_MESSAGE_SIZE
#define CLOCK_MESSAGE_SIZE
Definition: g_local.h:692
AS_SLIDING
#define AS_SLIDING
Definition: g_local.h:144
gitem_s::ammo
char * ammo
Definition: g_local.h:249
SV_Physics_None
void SV_Physics_None(edict_t *ent)
Definition: g_phys.c:613
fieldtype_t
fieldtype_t
Definition: g_local.h:565
droptofloor
void droptofloor(edict_t *ent)
Definition: g_items.c:867
DROPPED_PLAYER_ITEM
#define DROPPED_PLAYER_ITEM
Definition: g_local.h:558
game_locals_t::num_items
int num_items
Definition: g_local.h:287
client_persistant_t
Definition: g_local.h:821
MOD_HIT
#define MOD_HIT
Definition: g_local.h:489
M_MoveToGoal
void M_MoveToGoal(edict_t *ent, float dist)
Definition: m_move.c:477
forward
static vec3_t forward
Definition: p_view.c:27
TRAIL_LENGTH
#define TRAIL_LENGTH
Definition: p_trail.c:37
svc_temp_entity
#define svc_temp_entity
Definition: g_local.h:38
Svcmd_Test_f
void Svcmd_Test_f(void)
Definition: g_svcmds.c:22
crandom
#define crandom()
Definition: g_local.h:505
SV_CalcViewOffset
void SV_CalcViewOffset(edict_t *ent)
Definition: p_view.c:213
FL_GODMODE
#define FL_GODMODE
Definition: g_local.h:63
FindTarget
qboolean FindTarget(edict_t *self)
Definition: g_ai.c:385
MOVEDIR_DOWN
vec3_t MOVEDIR_DOWN
Definition: g_utils.c:294
AS_MISSILE
#define AS_MISSILE
Definition: g_local.h:146
ClientTeam
char * ClientTeam(edict_t *ent)
Definition: g_cmds.c:22
Info_ValueForKey
char * Info_ValueForKey(const char *s, const char *key)
Definition: shared.c:945
va
char * va(const char *format,...)
Definition: shared.c:429
M_CatagorizePosition
void M_CatagorizePosition(edict_t *ent)
Definition: g_monster.c:178
PlayerTrail_LastSpot
edict_t * PlayerTrail_LastSpot(void)
Definition: p_trail.c:136
M_WorldEffects
void M_WorldEffects(edict_t *ent)
Definition: g_monster.c:212
damage_t
damage_t
Definition: g_local.h:86
player_pain
void player_pain(edict_t *self, edict_t *other, float kick, int damage)
Definition: p_client.c:170
respawn
void respawn(edict_t *self)
Definition: p_client.c:957
M_FliesOn
void M_FliesOn(edict_t *self)
Definition: g_monster.c:111
game_locals_t::clients
gclient_t * clients
Definition: g_local.h:273
OnSameTeam
qboolean OnSameTeam(edict_t *ent1, edict_t *ent2)
Definition: g_cmds.c:46
client_respawn_t
Definition: g_local.h:858
vtos
char * vtos(vec3_t v)
Definition: g_utils.c:275
m
static struct mdfour * m
Definition: mdfour.c:32
AI_PURSUIT_LAST_SEEN
#define AI_PURSUIT_LAST_SEEN
Definition: g_local.h:130
game
game_locals_t game
Definition: g_main.c:21
FRAME_death106
#define FRAME_death106
Definition: m_actor.h:31
DeathmatchScoreboardMessage
void DeathmatchScoreboardMessage(edict_t *client, edict_t *killer)
Definition: p_hud.c:150
origin
static vec3_t origin
Definition: mesh.c:27
random
#define random()
Definition: g_local.h:504
WEAPON_FIRING
@ WEAPON_FIRING
Definition: g_local.h:96
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: shared.c:23
bobcycle
int bobcycle
Definition: p_view.c:31
DAMAGE_NO
@ DAMAGE_NO
Definition: g_local.h:87
CheckTeamDamage
qboolean CheckTeamDamage(edict_t *targ, edict_t *attacker)
Definition: g_combat.c:351
FL_NOTARGET
#define FL_NOTARGET
Definition: g_local.h:64
FRAME_death206
#define FRAME_death206
Definition: m_actor.h:38
gitem_s::pickup_name
char * pickup_name
Definition: g_local.h:245
G_InitEdict
void G_InitEdict(edict_t *e)
Definition: g_utils.c:372
globals
game_export_t globals
Definition: g_main.c:24
filterban
cvar_t * filterban
Definition: g_main.c:49
G_FreeEdict
void G_FreeEdict(edict_t *ed)
Definition: g_utils.c:421
level_locals_t::sound2_entity
edict_t * sound2_entity
Definition: g_local.h:318
CheckArmor
static int CheckArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage, int te_sparks, int dflags)
Definition: g_combat.c:243
level_locals_t::sight_entity
edict_t * sight_entity
Definition: g_local.h:314
func_clock_reset
static void func_clock_reset(edict_t *self)
Definition: g_misc.c:1564
AMMO_GRENADES
@ AMMO_GRENADES
Definition: g_local.h:103
respawn
void respawn(edict_t *ent)
Definition: p_client.c:957
F_SHORT
@ F_SHORT
Definition: g_local.h:568
player_die
void player_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: p_client.c:476
PNOISE_IMPACT
#define PNOISE_IMPACT
Definition: g_local.h:181
G_SetClientEvent
void G_SetClientEvent(edict_t *ent)
Definition: p_view.c:745
MOVETYPE_WALK
@ MOVETYPE_WALK
Definition: g_local.h:191
is_silenced
static byte is_silenced
Definition: p_weapon.c:25
trail
edict_t * trail[TRAIL_LENGTH]
Definition: p_trail.c:39
CanDamage
qboolean CanDamage(edict_t *targ, edict_t *inflictor)
Definition: g_combat.c:30
P_WorldEffects
void P_WorldEffects(void)
Definition: p_view.c:549
SVCmd_AddIP_f
void SVCmd_AddIP_f(void)
Definition: g_svcmds.c:151
skill
cvar_t * skill
Definition: g_main.c:36
level_locals_t::framenum
int framenum
Definition: g_local.h:298
HelpComputer
void HelpComputer(edict_t *ent)
Definition: p_hud.c:280
ClientObituary
void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker)
Definition: p_client.c:202
game_locals_t::autosaved
qboolean autosaved
Definition: g_local.h:289
level_locals_t::exitintermission
int exitintermission
Definition: g_local.h:308
PREV
#define PREV(n)
Definition: p_trail.c:44
DEAD_NO
#define DEAD_NO
Definition: g_local.h:110
cl
client_state_t cl
Definition: main.c:99
level_locals_t::time
float time
Definition: g_local.h:299
current_client
static gclient_t * current_client
Definition: p_view.c:25
FetchClientEntData
void FetchClientEntData(edict_t *ent)
Definition: p_client.c:652
fire_bullet
void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
Definition: g_weapon.c:255
Cmd_Help_f
void Cmd_Help_f(edict_t *ent)
Definition: p_hud.c:324
DROPPED_ITEM
#define DROPPED_ITEM
Definition: g_local.h:557
ClipGibVelocity
void ClipGibVelocity(edict_t *ent)
Definition: g_misc.c:68
VEC_UP
vec3_t VEC_UP
Definition: g_utils.c:291
gitem_s::pickup_sound
char * pickup_sound
Definition: g_local.h:238
PlayerTrail_PickFirst
edict_t * PlayerTrail_PickFirst(edict_t *self)
Definition: p_trail.c:92
coop
cvar_t * coop
Definition: g_main.c:34
AI_SOUND_TARGET
#define AI_SOUND_TARGET
Definition: g_local.h:128
level_locals_t::intermissiontime
float intermissiontime
Definition: g_local.h:306
G_SetSpectatorStats
void G_SetSpectatorStats(edict_t *ent)
Definition: p_hud.c:504
FRAME_crdeath1
#define FRAME_crdeath1
Definition: m_player.h:195
drop_temp_touch
void drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_items.c:781
visible
qboolean visible(edict_t *self, edict_t *other)
Definition: g_ai.c:268
ThrowClientHead
void ThrowClientHead(edict_t *self, int damage)
Definition: g_misc.c:218
sv_flaregun
cvar_t * sv_flaregun
Definition: g_main.c:76
power_screen_index
static int power_screen_index
Definition: g_items.c:45
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:391
level_locals_t::changemap
char * changemap
Definition: g_local.h:307
level_locals_t::sound_entity
edict_t * sound_entity
Definition: g_local.h:316
RANGE_MELEE
#define RANGE_MELEE
Definition: g_local.h:116
M_ReactToDamage
void M_ReactToDamage(edict_t *targ, edict_t *attacker)
Definition: g_combat.c:283
SVCmd_RemoveIP_f
void SVCmd_RemoveIP_f(void)
Definition: g_svcmds.c:180
level_locals_t::sound_entity_framenum
int sound_entity_framenum
Definition: g_local.h:317
DAMAGE_AIM
@ DAMAGE_AIM
Definition: g_local.h:89
gib_die
void gib_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: g_misc.c:125
up
static vec3_t up
Definition: p_view.c:27
PNOISE_SELF
#define PNOISE_SELF
Definition: g_local.h:179
bobmove
float bobmove
Definition: p_view.c:30
SV_movestep
qboolean SV_movestep(edict_t *ent, vec3_t move, qboolean relink)
Definition: m_move.c:108
c_yes
int c_yes
Definition: m_move.c:33
right
static vec3_t right
Definition: p_view.c:27
Killed
void Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: g_combat.c:89
SV_NewChaseDir
void SV_NewChaseDir(edict_t *actor, edict_t *enemy, float dist)
Definition: m_move.c:371
SpawnDamage
void SpawnDamage(int type, vec3_t origin, vec3_t normal, int damage)
Definition: g_combat.c:128
ChangeWeapon
void ChangeWeapon(edict_t *ent)
Definition: p_weapon.c:162
trail_head
int trail_head
Definition: p_trail.c:40
G_UseTargets
void G_UseTargets(edict_t *ent, edict_t *activator)
Definition: g_utils.c:166
IT_STAY_COOP
#define IT_STAY_COOP
Definition: g_local.h:214
CENTER_HANDED
#define CENTER_HANDED
Definition: g_local.h:163
enemy_range
int enemy_range
Definition: g_ai.c:28
Drop_Item
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
Definition: g_items.c:798
enemy_vis
qboolean enemy_vis
Definition: g_ai.c:27
GIB_ORGANIC
#define GIB_ORGANIC
Definition: g_local.h:122
client_persistant_t::game_helpchanged
int game_helpchanged
Definition: g_local.h:851
NEXT
#define NEXT(n)
Definition: p_trail.c:43
gitem_s::drop
void(* drop)(struct edict_s *ent, struct gitem_s *item)
Definition: g_local.h:236
level
level_locals_t level
Definition: g_main.c:22
MAXCHOICES
#define MAXCHOICES
Definition: g_utils.c:112
FRAME_crpain4
#define FRAME_crpain4
Definition: m_player.h:194
ChaseNext
void ChaseNext(edict_t *ent)
Definition: g_chase.c:107
LookAtKiller
void LookAtKiller(edict_t *self, edict_t *inflictor, edict_t *attacker)
Definition: p_client.c:443
ipfilters
ipfilter_t ipfilters[MAX_IPFILTERS]
Definition: g_svcmds.c:65
GetItemByIndex
gitem_t * GetItemByIndex(int index)
Definition: g_items.c:61
fire_lead
static void fire_lead(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int te_impact, int hspread, int vspread, int mod)
Definition: g_weapon.c:126
PlayerNoise
void PlayerNoise(edict_t *who, vec3_t where, int type)
Definition: p_weapon.c:56
RANGE_MID
#define RANGE_MID
Definition: g_local.h:118
SelectSpawnPoint
void SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles)
Definition: p_client.c:847
MOD_UNKNOWN
#define MOD_UNKNOWN
Definition: g_local.h:457
swimmonster_start_go
void swimmonster_start_go(edict_t *self)
Definition: g_monster.c:661
SV_StepDirection
qboolean SV_StepDirection(edict_t *ent, float yaw, float dist)
Definition: m_move.c:322
FL_FLY
#define FL_FLY
Definition: g_local.h:59
is_quad
static qboolean is_quad
Definition: p_weapon.c:24
G_SetStats
void G_SetStats(edict_t *ent)
Definition: p_hud.c:353
KillBox
qboolean KillBox(edict_t *ent)
Definition: g_utils.c:515
ai_run_slide
void ai_run_slide(edict_t *self, float distance)
Definition: g_ai.c:674
MOVETYPE_BOUNCE
@ MOVETYPE_BOUNCE
Definition: g_local.h:196
PutClientInServer
void PutClientInServer(edict_t *ent)
Definition: p_client.c:1073
numipfilters
int numipfilters
Definition: g_svcmds.c:66
func_clock_format_countdown
static void func_clock_format_countdown(edict_t *self)
Definition: g_misc.c:1576
SelectNextItem
void SelectNextItem(edict_t *ent, int itflags)
Definition: g_cmds.c:63
svc_layout
#define svc_layout
Definition: g_local.h:39
fire_blaster
void fire_blaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
Definition: g_weapon.c:319
F_BAD
@ F_BAD
Definition: g_local.h:566
STEPSIZE
#define STEPSIZE
Definition: m_move.c:22
P_DamageFeedback
void P_DamageFeedback(edict_t *player)
Definition: p_view.c:69
SV_Physics_Toss
void SV_Physics_Toss(edict_t *ent)
Definition: g_phys.c:655
AI_PURSUE_NEXT
#define AI_PURSUE_NEXT
Definition: g_local.h:131
FRAME_death308
#define FRAME_death308
Definition: m_actor.h:53
MOVETYPE_TOSS
@ MOVETYPE_TOSS
Definition: g_local.h:194
range
int range(edict_t *self, edict_t *other)
Definition: g_ai.c:245
G_CheckChaseStats
void G_CheckChaseStats(edict_t *ent)
Definition: p_hud.c:485
ChangeWeapon
void ChangeWeapon(edict_t *ent)
Definition: p_weapon.c:162
dmflags
cvar_t * dmflags
Definition: g_main.c:35
F_LSTRING
@ F_LSTRING
Definition: g_local.h:571
power_shield_index
static int power_shield_index
Definition: g_items.c:46
current_player
static edict_t * current_player
Definition: p_view.c:24
M_ChangeYaw
void M_ChangeYaw(edict_t *ent)
Definition: m_move.c:279
int
CONST PIXELFORMATDESCRIPTOR int
Definition: wgl.c:26
CheckPowerArmor
static int CheckPowerArmor(edict_t *ent, vec3_t point, vec3_t normal, int damage, int dflags)
Definition: g_combat.c:165
bfg_think
void bfg_think(edict_t *self)
Definition: g_weapon.c:755
game_locals_t::maxentities
int maxentities
Definition: g_local.h:281
trail_active
qboolean trail_active
Definition: p_trail.c:41
gitem_s::view_model
char * view_model
Definition: g_local.h:241
fire_shotgun
void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
Definition: g_weapon.c:268
G_SetClientFrame
void G_SetClientFrame(edict_t *ent)
Definition: p_view.c:799
VelocityForDamage
void VelocityForDamage(int damage, vec3_t v)
Definition: g_misc.c:56
Pickup_AncientHead
qboolean Pickup_AncientHead(edict_t *ent, edict_t *other)
Definition: g_items.c:205
P_FallingDamage
void P_FallingDamage(edict_t *ent)
Definition: p_view.c:479
G_PickTarget
edict_t * G_PickTarget(char *targetname)
Definition: g_utils.c:114
AI_DUCKED
#define AI_DUCKED
Definition: g_local.h:137
F_POINTER
@ F_POINTER
Definition: g_local.h:580
level_locals_t::sound2_entity_framenum
int sound2_entity_framenum
Definition: g_local.h:319
PlayerTrail_Add
void PlayerTrail_Add(vec3_t spot)
Definition: p_trail.c:64
DeathmatchScoreboardMessage
void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
Definition: p_hud.c:150
PlayerTrail_Init
void PlayerTrail_Init(void)
Definition: p_trail.c:47
AS_MELEE
#define AS_MELEE
Definition: g_local.h:145
RANGE_FAR
#define RANGE_FAR
Definition: g_local.h:119
F_INT
@ F_INT
Definition: g_local.h:569
gitem_s::flags
int flags
Definition: g_local.h:250
SV_Physics_Step
void SV_Physics_Step(edict_t *ent)
Definition: g_phys.c:794
F_ANGLEHACK
@ F_ANGLEHACK
Definition: g_local.h:575
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: shared.c:55
MOVETYPE_FLY
@ MOVETYPE_FLY
Definition: g_local.h:193
POWER_ARMOR_NONE
#define POWER_ARMOR_NONE
Definition: g_local.h:156
gitem_s::tag
int tag
Definition: g_local.h:255
InitClientPersistant
void InitClientPersistant(gclient_t *client)
Definition: p_client.c:575
Pickup_Powerup
qboolean Pickup_Powerup(edict_t *ent, edict_t *other)
Definition: g_items.c:155
F_GSTRING
@ F_GSTRING
Definition: g_local.h:572
MOD_FRIENDLY_FIRE
#define MOD_FRIENDLY_FIRE
Definition: g_local.h:491
SV_CalcBlend
void SV_CalcBlend(edict_t *ent)
Definition: p_view.c:402
blaster_touch
void blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_weapon.c:284
SVCmd_WriteIP_f
void SVCmd_WriteIP_f(void)
Definition: g_svcmds.c:227
AS_STRAIGHT
#define AS_STRAIGHT
Definition: g_local.h:143
AMMO_CELLS
@ AMMO_CELLS
Definition: g_local.h:104
gitem_s::classname
char * classname
Definition: g_local.h:233
level_locals_t::intermission_angle
vec3_t intermission_angle
Definition: g_local.h:310
gitem_s
Definition: g_local.h:232
AMMO_SLUGS
@ AMMO_SLUGS
Definition: g_local.h:105
game_locals_t::maxclients
int maxclients
Definition: g_local.h:280