codemp/game/g_local.h File Reference

#include "q_shared.h"
#include "bg_public.h"
#include "bg_vehicles.h"
#include "g_public.h"
#include "b_public.h"
#include "../namespace_begin.h"
#include "../namespace_end.h"
#include "g_team.h"

Go to the source code of this file.

Data Structures

struct  alertEvent_s
struct  bot_settings_s
struct  clientPersistant_t
struct  clientSession_t
struct  combatPoint_t
struct  gclient_s
struct  gentity_s
struct  interestPoint_t
struct  level_locals_t
struct  playerTeamState_t
struct  reference_tag_s
struct  renderInfo_s
struct  waypointData_t

Defines

#define GAME_INLINE   ID_INLINE
#define GAMEVERSION   "basejka_mod"
#define BODY_QUEUE_SIZE   8
#define INFINITE   1000000
#define FRAMETIME   100
#define CARNAGE_REWARD_TIME   3000
#define REWARD_SPRITE_TIME   2000
#define INTERMISSION_DELAY_TIME   1000
#define SP_INTERMISSION_DELAY_TIME   5000
#define START_TIME_LINK_ENTS   FRAMETIME*1
#define START_TIME_FIND_LINKS   FRAMETIME*2
#define START_TIME_MOVERS_SPAWNED   FRAMETIME*2
#define START_TIME_REMOVE_ENTS   FRAMETIME*3
#define START_TIME_NAV_CALC   FRAMETIME*4
#define START_TIME_FIND_WAYPOINT   FRAMETIME*5
#define FL_GODMODE   0x00000010
#define FL_NOTARGET   0x00000020
#define FL_TEAMSLAVE   0x00000400
#define FL_NO_KNOCKBACK   0x00000800
#define FL_DROPPED_ITEM   0x00001000
#define FL_NO_BOTS   0x00002000
#define FL_NO_HUMANS   0x00004000
#define FL_FORCE_GESTURE   0x00008000
#define FL_INACTIVE   0x00010000
#define FL_NAVGOAL   0x00020000
#define FL_DONT_SHOOT   0x00040000
#define FL_SHIELDED   0x00080000
#define FL_UNDYING   0x00100000
#define FL_BOUNCE   0x00100000
#define FL_BOUNCE_HALF   0x00200000
#define FL_BOUNCE_SHRAPNEL   0x00400000
#define FL_VEH_BOARDING   0x00800000
#define FL_DMG_BY_SABER_ONLY   0x01000000
#define FL_DMG_BY_HEAVY_WEAP_ONLY   0x02000000
#define FL_BBRUSH   0x04000000
#define DEBUG_SABER_BOX
#define MAX_G_SHARED_BUFFER_SIZE   8192
#define SP_PODIUM_MODEL   "models/mapobjects/podium/podium4.md3"
#define DAMAGEREDIRECT_HEAD   1
#define DAMAGEREDIRECT_RLEG   2
#define DAMAGEREDIRECT_LLEG   3
#define FOLLOW_ACTIVE1   -1
#define FOLLOW_ACTIVE2   -2
#define PSG_VOTED   (1<<0)
#define PSG_TEAMVOTED   (1<<1)
#define MAX_NETNAME   36
#define MAX_VOTE_COUNT   3
#define MAX_INTEREST_POINTS   64
#define MAX_COMBAT_POINTS   512
#define MAX_ALERT_EVENTS   32
#define DAMAGE_NORMAL   0x00000000
#define DAMAGE_RADIUS   0x00000001
#define DAMAGE_NO_ARMOR   0x00000002
#define DAMAGE_NO_KNOCKBACK   0x00000004
#define DAMAGE_NO_PROTECTION   0x00000008
#define DAMAGE_NO_TEAM_PROTECTION   0x00000010
#define DAMAGE_EXTRA_KNOCKBACK   0x00000040
#define DAMAGE_DEATH_KNOCKBACK   0x00000080
#define DAMAGE_IGNORE_TEAM   0x00000100
#define DAMAGE_NO_DAMAGE   0x00000200
#define DAMAGE_HALF_ABSORB   0x00000400
#define DAMAGE_HALF_ARMOR_REDUCTION   0x00000800
#define DAMAGE_HEAVY_WEAP_CLASS   0x00001000
#define DAMAGE_NO_HIT_LOC   0x00002000
#define DAMAGE_NO_SELF_PROTECTION   0x00004000
#define DAMAGE_NO_DISMEMBER   0x00008000
#define DAMAGE_SABER_KNOCKBACK1   0x00010000
#define DAMAGE_SABER_KNOCKBACK2   0x00020000
#define DAMAGE_SABER_KNOCKBACK1_B2   0x00040000
#define DAMAGE_SABER_KNOCKBACK2_B2   0x00080000
#define SPF_BUTTON_USABLE   1
#define SPF_BUTTON_FPUSHABLE   2
#define MAX_REFNAME   32
#define START_TIME_LINK_ENTS   FRAMETIME*1
#define RTF_NONE   0
#define RTF_NAVGOAL   0x00000001
#define MAX_FILEPATH   144
#define FOFS(x)   ((int)&(((gentity_t *)0)->x))

Typedefs

typedef gentity_s gentity_t
typedef gclient_s gclient_t
typedef int clientConnected_t
typedef renderInfo_s renderInfo_t
typedef alertEvent_s alertEvent_t
typedef reference_tag_s reference_tag_t
typedef bot_settings_s bot_settings_t

Enumerations

enum  moverState_t { MOVER_POS1, MOVER_POS2, MOVER_1TO2, MOVER_2TO1 }
enum  {
  HL_NONE = 0, HL_FOOT_RT, HL_FOOT_LT, HL_LEG_RT,
  HL_LEG_LT, HL_WAIST, HL_BACK_RT, HL_BACK_LT,
  HL_BACK, HL_CHEST_RT, HL_CHEST_LT, HL_CHEST,
  HL_ARM_RT, HL_ARM_LT, HL_HAND_RT, HL_HAND_LT,
  HL_HEAD, HL_GENERIC1, HL_GENERIC2, HL_GENERIC3,
  HL_GENERIC4, HL_GENERIC5, HL_GENERIC6, HL_MAX
}
enum  { CON_DISCONNECTED, CON_CONNECTING, CON_CONNECTED }
enum  spectatorState_t { SPECTATOR_NOT, SPECTATOR_FREE, SPECTATOR_FOLLOW, SPECTATOR_SCOREBOARD }
enum  playerTeamStateState_t { TEAM_BEGIN, TEAM_ACTIVE }
enum  alertEventType_e { AET_SIGHT, AET_SOUND }
enum  alertEventLevel_e {
  AEL_MINOR, AEL_SUSPICIOUS, AEL_DISCOVERED, AEL_DANGER,
  AEL_DANGER_GREAT
}

Functions

qboolean G_SpawnString (const char *key, const char *defaultString, char **out)
qboolean G_SpawnFloat (const char *key, const char *defaultString, float *out)
qboolean G_SpawnInt (const char *key, const char *defaultString, int *out)
qboolean G_SpawnVector (const char *key, const char *defaultString, float *out)
void G_SpawnEntitiesFromString (qboolean inSubBSP)
char * G_NewString (const char *string)
void Cmd_Score_f (gentity_t *ent)
void StopFollowing (gentity_t *ent)
void BroadcastTeamChange (gclient_t *client, int oldTeam)
void SetTeam (gentity_t *ent, char *s)
void Cmd_FollowCycle_f (gentity_t *ent, int dir)
void Cmd_SaberAttackCycle_f (gentity_t *ent)
int G_ItemUsable (playerState_t *ps, int forcedUse)
void Cmd_ToggleSaber_f (gentity_t *ent)
void Cmd_EngageDuel_f (gentity_t *ent)
gentity_tG_GetDuelWinner (gclient_t *client)
void ItemUse_Binoculars (gentity_t *ent)
void ItemUse_Shield (gentity_t *ent)
void ItemUse_Sentry (gentity_t *ent)
void Jetpack_Off (gentity_t *ent)
void Jetpack_On (gentity_t *ent)
void ItemUse_Jetpack (gentity_t *ent)
void ItemUse_UseCloak (gentity_t *ent)
void ItemUse_UseDisp (gentity_t *ent, int type)
void ItemUse_UseEWeb (gentity_t *ent)
void G_PrecacheDispensers (void)
void ItemUse_Seeker (gentity_t *ent)
void ItemUse_MedPack (gentity_t *ent)
void ItemUse_MedPack_Big (gentity_t *ent)
void G_CheckTeamItems (void)
void G_RunItem (gentity_t *ent)
void RespawnItem (gentity_t *ent)
void UseHoldableItem (gentity_t *ent)
void PrecacheItem (gitem_t *it)
gentity_tDrop_Item (gentity_t *ent, gitem_t *item, float angle)
gentity_tLaunchItem (gitem_t *item, vec3_t origin, vec3_t velocity)
void SetRespawn (gentity_t *ent, float delay)
void G_SpawnItem (gentity_t *ent, gitem_t *item)
void FinishSpawningItem (gentity_t *ent)
void Think_Weapon (gentity_t *ent)
int ArmorIndex (gentity_t *ent)
void Add_Ammo (gentity_t *ent, int weapon, int count)
void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace)
void ClearRegisteredItems (void)
void RegisterItem (gitem_t *item)
void SaveRegisteredItems (void)
int G_ModelIndex (const char *name)
int G_SoundIndex (const char *name)
int G_SoundSetIndex (const char *name)
int G_EffectIndex (const char *name)
int G_BSPIndex (const char *name)
int G_IconIndex (const char *name)
qboolean G_PlayerHasCustomSkeleton (gentity_t *ent)
void G_TeamCommand (team_t team, char *cmd)
void G_ScaleNetHealth (gentity_t *self)
void G_KillBox (gentity_t *ent)
gentity_tG_Find (gentity_t *from, int fieldofs, const char *match)
int G_RadiusList (vec3_t origin, float radius, gentity_t *ignore, qboolean takeDamage, gentity_t *ent_list[MAX_GENTITIES])
void G_Throw (gentity_t *targ, vec3_t newDir, float push)
void G_FreeFakeClient (gclient_t **cl)
void G_CreateFakeClient (int entNum, gclient_t **cl)
void G_CleanAllFakeClients (void)
void G_SetAnim (gentity_t *ent, usercmd_t *ucmd, int setAnimParts, int anim, int setAnimFlags, int blendTime)
gentity_tG_PickTarget (char *targetname)
void GlobalUse (gentity_t *self, gentity_t *other, gentity_t *activator)
void G_UseTargets2 (gentity_t *ent, gentity_t *activator, const char *string)
void G_UseTargets (gentity_t *ent, gentity_t *activator)
void G_SetMovedir (vec3_t angles, vec3_t movedir)
void G_SetAngles (gentity_t *ent, vec3_t angles)
void G_InitGentity (gentity_t *e)
gentity_tG_Spawn (void)
gentity_tG_TempEntity (vec3_t origin, int event)
gentity_tG_PlayEffect (int fxID, vec3_t org, vec3_t ang)
gentity_tG_PlayEffectID (const int fxID, vec3_t org, vec3_t ang)
gentity_tG_ScreenShake (vec3_t org, gentity_t *target, float intensity, int duration, qboolean global)
void G_MuteSound (int entnum, int channel)
void G_Sound (gentity_t *ent, int channel, int soundIndex)
void G_SoundAtLoc (vec3_t loc, int channel, int soundIndex)
void G_EntitySound (gentity_t *ent, int channel, int soundIndex)
void TryUse (gentity_t *ent)
void G_SendG2KillQueue (void)
void G_KillG2Queue (int entNum)
void G_FreeEntity (gentity_t *e)
qboolean G_EntitiesFree (void)
qboolean G_ActivateBehavior (gentity_t *self, int bset)
void G_TouchTriggers (gentity_t *ent)
void G_TouchSolids (gentity_t *ent)
void GetAnglesForDirection (const vec3_t p1, const vec3_t p2, vec3_t out)
void G_RunObject (gentity_t *ent)
float * tv (float x, float y, float z)
char * vtos (const vec3_t v)
void G_AddPredictableEvent (gentity_t *ent, int event, int eventParm)
void G_AddEvent (gentity_t *ent, int event, int eventParm)
void G_SetOrigin (gentity_t *ent, vec3_t origin)
qboolean G_CheckInSolid (gentity_t *self, qboolean fix)
void AddRemap (const char *oldShader, const char *newShader, float timeOffset)
const char * BuildShaderStateConfig (void)
int G_BoneIndex (const char *name)
qhandle_t trap_R_RegisterSkin (const char *name)
void trap_G2_ListModelSurfaces (void *ghlInfo)
void trap_G2_ListModelBones (void *ghlInfo, int frame)
void trap_G2_SetGhoul2ModelIndexes (void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
qboolean trap_G2_HaveWeGhoul2Models (void *ghoul2)
qboolean trap_G2API_GetBoltMatrix (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
qboolean trap_G2API_GetBoltMatrix_NoReconstruct (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
qboolean trap_G2API_GetBoltMatrix_NoRecNoRot (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
int trap_G2API_InitGhoul2Model (void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin, qhandle_t customShader, int modelFlags, int lodBias)
qboolean trap_G2API_SetSkin (void *ghoul2, int modelIndex, qhandle_t customSkin, qhandle_t renderSkin)
int trap_G2API_Ghoul2Size (void *ghlInfo)
int trap_G2API_AddBolt (void *ghoul2, int modelIndex, const char *boneName)
void trap_G2API_SetBoltInfo (void *ghoul2, int modelIndex, int boltInfo)
int trap_G2API_CopyGhoul2Instance (void *g2From, void *g2To, int modelIndex)
void trap_G2API_CopySpecificGhoul2Model (void *g2From, int modelFrom, void *g2To, int modelTo)
void trap_G2API_DuplicateGhoul2Instance (void *g2From, void **g2To)
qboolean trap_G2API_HasGhoul2ModelOnIndex (void *ghlInfo, int modelIndex)
qboolean trap_G2API_RemoveGhoul2Model (void *ghlInfo, int modelIndex)
qboolean trap_G2API_RemoveGhoul2Models (void *ghlInfo)
void trap_G2API_CleanGhoul2Models (void **ghoul2Ptr)
void trap_G2API_CollisionDetect (CollisionRecord_t *collRecMap, void *ghoul2, const vec3_t angles, const vec3_t position, int frameNumber, int entNum, vec3_t rayStart, vec3_t rayEnd, vec3_t scale, int traceFlags, int useLod, float fRadius)
void trap_G2API_CollisionDetectCache (CollisionRecord_t *collRecMap, void *ghoul2, const vec3_t angles, const vec3_t position, int frameNumber, int entNum, vec3_t rayStart, vec3_t rayEnd, vec3_t scale, int traceFlags, int useLod, float fRadius)
qboolean trap_G2API_SetBoneAngles (void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags, const int up, const int right, const int forward, qhandle_t *modelList, int blendTime, int currentTime)
void trap_G2API_GetGLAName (void *ghoul2, int modelIndex, char *fillBuf)
qboolean trap_G2API_SetBoneAnim (void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame, const int flags, const float animSpeed, const int currentTime, const float setFrame, const int blendTime)
qboolean trap_G2API_GetBoneAnim (void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *startFrame, int *endFrame, int *flags, float *animSpeed, int *modelList, const int modelIndex)
void trap_G2API_GetSurfaceName (void *ghoul2, int surfNumber, int modelIndex, char *fillBuf)
qboolean trap_G2API_SetRootSurface (void *ghoul2, const int modelIndex, const char *surfaceName)
qboolean trap_G2API_SetSurfaceOnOff (void *ghoul2, const char *surfaceName, const int flags)
qboolean trap_G2API_SetNewOrigin (void *ghoul2, const int boltIndex)
qboolean trap_G2API_DoesBoneExist (void *ghoul2, int modelIndex, const char *boneName)
int trap_G2API_GetSurfaceRenderStatus (void *ghoul2, const int modelIndex, const char *surfaceName)
void trap_G2API_AbsurdSmoothing (void *ghoul2, qboolean status)
void trap_G2API_SetRagDoll (void *ghoul2, sharedRagDollParams_t *params)
void trap_G2API_AnimateG2Models (void *ghoul2, int time, sharedRagDollUpdateParams_t *params)
qboolean trap_G2API_RagPCJConstraint (void *ghoul2, const char *boneName, vec3_t min, vec3_t max)
qboolean trap_G2API_RagPCJGradientSpeed (void *ghoul2, const char *boneName, const float speed)
qboolean trap_G2API_RagEffectorGoal (void *ghoul2, const char *boneName, vec3_t pos)
qboolean trap_G2API_GetRagBonePos (void *ghoul2, const char *boneName, vec3_t pos, vec3_t entAngles, vec3_t entPos, vec3_t entScale)
qboolean trap_G2API_RagEffectorKick (void *ghoul2, const char *boneName, vec3_t velocity)
qboolean trap_G2API_RagForceSolve (void *ghoul2, qboolean force)
qboolean trap_G2API_SetBoneIKState (void *ghoul2, int time, const char *boneName, int ikState, sharedSetBoneIKStateParams_t *params)
qboolean trap_G2API_IKMove (void *ghoul2, int time, sharedIKMoveParams_t *params)
qboolean trap_G2API_RemoveBone (void *ghoul2, const char *boneName, int modelIndex)
void trap_G2API_AttachInstanceToEntNum (void *ghoul2, int entityNum, qboolean server)
void trap_G2API_ClearAttachedInstance (int entityNum)
void trap_G2API_CleanEntAttachments (void)
qboolean trap_G2API_OverrideServer (void *serverInstance)
qboolean CanDamage (gentity_t *targ, vec3_t origin)
void G_Damage (gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod)
qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, gentity_t *missile, int mod)
void body_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath)
void TossClientWeapon (gentity_t *self, vec3_t direction, float speed)
void TossClientItems (gentity_t *self)
void TossClientCubes (gentity_t *self)
void ExplodeDeath (gentity_t *self)
void G_CheckForDismemberment (gentity_t *ent, gentity_t *enemy, vec3_t point, int damage, int deathAnim, qboolean postDeath)
void G_RunExPhys (gentity_t *ent, float gravity, float mass, float bounce, qboolean autoKill, int *g2Bolts, int numG2Bolts)
void G_ReflectMissile (gentity_t *ent, gentity_t *missile, vec3_t forward)
void G_RunMissile (gentity_t *ent)
gentity_tCreateMissile (vec3_t org, vec3_t dir, float vel, int life, gentity_t *owner, qboolean altFire)
void G_BounceProjectile (vec3_t start, vec3_t impact, vec3_t dir, vec3_t endout)
void G_ExplodeMissile (gentity_t *ent)
void WP_FireBlasterMissile (gentity_t *ent, vec3_t start, vec3_t dir, qboolean altFire)
void G_PlayDoorLoopSound (gentity_t *ent)
void G_PlayDoorSound (gentity_t *ent, int type)
void G_RunMover (gentity_t *ent)
void Touch_DoorTrigger (gentity_t *ent, gentity_t *other, trace_t *trace)
void trigger_teleporter_touch (gentity_t *self, gentity_t *other, trace_t *trace)
void TAG_Init (void)
reference_tag_tTAG_Find (const char *owner, const char *name)
reference_tag_tTAG_Add (const char *name, const char *owner, vec3_t origin, vec3_t angles, int radius, int flags)
int TAG_GetOrigin (const char *owner, const char *name, vec3_t origin)
int TAG_GetOrigin2 (const char *owner, const char *name, vec3_t origin)
int TAG_GetAngles (const char *owner, const char *name, vec3_t angles)
int TAG_GetRadius (const char *owner, const char *name)
int TAG_GetFlags (const char *owner, const char *name)
void TeleportPlayer (gentity_t *player, vec3_t origin, vec3_t angles)
void WP_FireTurretMissile (gentity_t *ent, vec3_t start, vec3_t dir, qboolean altFire, int damage, int velocity, int mod, gentity_t *ignore)
void WP_FireGenericBlasterMissile (gentity_t *ent, vec3_t start, vec3_t dir, qboolean altFire, int damage, int velocity, int mod)
qboolean LogAccuracyHit (gentity_t *target, gentity_t *attacker)
void CalcMuzzlePoint (gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint)
void SnapVectorTowards (vec3_t v, vec3_t to)
qboolean CheckGauntletAttack (gentity_t *ent)
team_t TeamCount (int ignoreClientNum, int team)
int TeamLeader (int team)
team_t PickTeam (int ignoreClientNum)
void SetClientViewAngle (gentity_t *ent, vec3_t angle)
gentity_tSelectSpawnPoint (vec3_t avoidPoint, vec3_t origin, vec3_t angles, team_t team)
void MaintainBodyQueue (gentity_t *ent)
void respawn (gentity_t *ent)
void BeginIntermission (void)
void InitBodyQue (void)
void ClientSpawn (gentity_t *ent)
void player_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod)
void AddScore (gentity_t *ent, vec3_t origin, int score)
void CalculateRanks (void)
qboolean SpotWouldTelefrag (gentity_t *spot)
qboolean ConsoleCommand (void)
void G_ProcessIPBans (void)
qboolean G_FilterPacket (char *from)
void FireWeapon (gentity_t *ent, qboolean altFire)
void BlowDetpacks (gentity_t *ent)
void MoveClientToIntermission (gentity_t *client)
void G_SetStats (gentity_t *ent)
void DeathmatchScoreboardMessage (gentity_t *client)
void G_PowerDuelCount (int *loners, int *doubles, qboolean countSpec)
void FindIntermissionPoint (void)
void SetLeader (int team, int client)
void CheckTeamLeader (int team)
void G_RunThink (gentity_t *ent)
void QDECL G_LogPrintf (const char *fmt,...)
void SendScoreboardMessageToAllClients (void)
void QDECL G_Printf (const char *fmt,...)
void QDECL G_Error (const char *fmt,...)
const char * G_GetStringEdString (char *refSection, char *refName)
char * ClientConnect (int clientNum, qboolean firstTime, qboolean isBot)
void ClientUserinfoChanged (int clientNum)
void ClientDisconnect (int clientNum)
void ClientBegin (int clientNum, qboolean allowTeamReset)
void G_BreakArm (gentity_t *ent, int arm)
void G_UpdateClientAnims (gentity_t *self, float animSpeedScale)
void ClientCommand (int clientNum)
void G_CheckClientTimeouts (gentity_t *ent)
void ClientThink (int clientNum, usercmd_t *ucmd)
void ClientEndFrame (gentity_t *ent)
void G_RunClient (gentity_t *ent)
qboolean OnSameTeam (gentity_t *ent1, gentity_t *ent2)
void Team_CheckDroppedItem (gentity_t *dropped)
void * G_Alloc (int size)
void G_InitMemory (void)
void Svcmd_GameMem_f (void)
void G_ReadSessionData (gclient_t *client)
void G_InitSessionData (gclient_t *client, char *userinfo, qboolean isBot)
void G_InitWorldSession (void)
void G_WriteSessionData (void)
void AddSightEvent (gentity_t *owner, vec3_t position, float radius, alertEventLevel_e alertLevel, float addLight)
void AddSoundEvent (gentity_t *owner, vec3_t position, float radius, alertEventLevel_e alertLevel, qboolean needLOS)
qboolean G_CheckForDanger (gentity_t *self, int alertEvent)
int G_CheckAlertEvents (gentity_t *self, qboolean checkSight, qboolean checkSound, float maxSeeDist, float maxHearDist, int ignoreAlert, qboolean mustHaveOwner, int minAlertLevel)
qboolean G_ClearLOS (gentity_t *self, const vec3_t start, const vec3_t end)
qboolean G_ClearLOS2 (gentity_t *self, gentity_t *ent, const vec3_t end)
qboolean G_ClearLOS3 (gentity_t *self, const vec3_t start, gentity_t *ent)
qboolean G_ClearLOS4 (gentity_t *self, gentity_t *ent)
qboolean G_ClearLOS5 (gentity_t *self, const vec3_t end)
void UpdateTournamentInfo (void)
void G_InitBots (qboolean restart)
char * G_GetBotInfoByNumber (int num)
char * G_GetBotInfoByName (const char *name)
void G_CheckBotSpawn (void)
void G_RemoveQueuedBotBegin (int clientNum)
qboolean G_BotConnect (int clientNum, qboolean restart)
void Svcmd_AddBot_f (void)
void Svcmd_BotList_f (void)
void BotInterbreedEndMatch (void)
qboolean G_DoesMapSupportGametype (const char *mapname, int gametype)
const char * G_RefreshNextMap (int gametype, qboolean forced)
gentity_tG_PreDefSound (vec3_t org, int pdSound)
qboolean HasSetSaberOnly (void)
void WP_ForcePowerStop (gentity_t *self, forcePowers_t forcePower)
void WP_SaberPositionUpdate (gentity_t *self, usercmd_t *ucmd)
int WP_SaberCanBlock (gentity_t *self, vec3_t point, int dflags, int mod, qboolean projectile, int attackStr)
void WP_SaberInitBladeData (gentity_t *ent)
void WP_InitForcePowers (gentity_t *ent)
void WP_SpawnInitForcePowers (gentity_t *ent)
void WP_ForcePowersUpdate (gentity_t *self, usercmd_t *ucmd)
int ForcePowerUsableOn (gentity_t *attacker, gentity_t *other, forcePowers_t forcePower)
void ForceHeal (gentity_t *self)
void ForceSpeed (gentity_t *self, int forceDuration)
void ForceRage (gentity_t *self)
void ForceGrip (gentity_t *self)
void ForceProtect (gentity_t *self)
void ForceAbsorb (gentity_t *self)
void ForceTeamHeal (gentity_t *self)
void ForceTeamForceReplenish (gentity_t *self)
void ForceSeeing (gentity_t *self)
void ForceThrow (gentity_t *self, qboolean pull)
void ForceTelepathy (gentity_t *self)
qboolean Jedi_DodgeEvasion (gentity_t *self, gentity_t *shooter, trace_t *tr, int hitLoc)
void QDECL G_LogWeaponPickup (int client, int weaponid)
void QDECL G_LogWeaponFire (int client, int weaponid)
void QDECL G_LogWeaponDamage (int client, int mod, int amount)
void QDECL G_LogWeaponKill (int client, int mod)
void QDECL G_LogWeaponDeath (int client, int weaponid)
void QDECL G_LogWeaponFrag (int attacker, int deadguy)
void QDECL G_LogWeaponPowerup (int client, int powerupid)
void QDECL G_LogWeaponItem (int client, int itemid)
void QDECL G_LogWeaponInit (void)
void QDECL G_LogWeaponOutput (void)
void QDECL G_LogExit (const char *string)
void QDECL G_ClearClientLog (int client)
void InitSiegeMode (void)
void G_SiegeClientExData (gentity_t *msgTarg)
void TIMER_Clear (void)
void TIMER_Clear2 (gentity_t *ent)
void TIMER_Set (gentity_t *ent, const char *identifier, int duration)
int TIMER_Get (gentity_t *ent, const char *identifier)
qboolean TIMER_Done (gentity_t *ent, const char *identifier)
qboolean TIMER_Start (gentity_t *self, const char *identifier, int duration)
qboolean TIMER_Done2 (gentity_t *ent, const char *identifier, qboolean remove)
qboolean TIMER_Exists (gentity_t *ent, const char *identifier)
void TIMER_Remove (gentity_t *ent, const char *identifier)
float NPC_GetHFOVPercentage (vec3_t spot, vec3_t from, vec3_t facing, float hFOV)
float NPC_GetVFOVPercentage (vec3_t spot, vec3_t from, vec3_t facing, float vFOV)
void G_SetEnemy (gentity_t *self, gentity_t *enemy)
qboolean InFront (vec3_t spot, vec3_t from, vec3_t fromAngles, float threshHold)
int OrgVisible (vec3_t org1, vec3_t org2, int ignore)
void BotOrder (gentity_t *ent, int clientnum, int ordernum)
int InFieldOfVision (vec3_t viewangles, float fov, vec3_t angles)
void B_InitAlloc (void)
void B_CleanupAlloc (void)
int BotAISetup (int restart)
int BotAIShutdown (int restart)
int BotAILoadMap (int restart)
int BotAISetupClient (int client, struct bot_settings_s *settings, qboolean restart)
int BotAIShutdownClient (int client, qboolean restart)
int BotAIStartFrame (int time)
void trap_Printf (const char *fmt)
void trap_Error (const char *fmt)
int trap_Milliseconds (void)
void trap_PrecisionTimer_Start (void **theNewTimer)
int trap_PrecisionTimer_End (void *theTimer)
int trap_Argc (void)
void trap_Argv (int n, char *buffer, int bufferLength)
void trap_Args (char *buffer, int bufferLength)
int trap_FS_FOpenFile (const char *qpath, fileHandle_t *f, fsMode_t mode)
void trap_FS_Read (void *buffer, int len, fileHandle_t f)
void trap_FS_Write (const void *buffer, int len, fileHandle_t f)
void trap_FS_FCloseFile (fileHandle_t f)
int trap_FS_GetFileList (const char *path, const char *extension, char *listbuf, int bufsize)
void trap_SendConsoleCommand (int exec_when, const char *text)
void trap_Cvar_Register (vmCvar_t *cvar, const char *var_name, const char *value, int flags)
void trap_Cvar_Update (vmCvar_t *cvar)
void trap_Cvar_Set (const char *var_name, const char *value)
int trap_Cvar_VariableIntegerValue (const char *var_name)
float trap_Cvar_VariableValue (const char *var_name)
void trap_Cvar_VariableStringBuffer (const char *var_name, char *buffer, int bufsize)
void trap_LocateGameData (gentity_t *gEnts, int numGEntities, int sizeofGEntity_t, playerState_t *gameClients, int sizeofGameClient)
void trap_DropClient (int clientNum, const char *reason)
void trap_SendServerCommand (int clientNum, const char *text)
void trap_SetConfigstring (int num, const char *string)
void trap_GetConfigstring (int num, char *buffer, int bufferSize)
void trap_GetUserinfo (int num, char *buffer, int bufferSize)
void trap_SetUserinfo (int num, const char *buffer)
void trap_GetServerinfo (char *buffer, int bufferSize)
void trap_SetServerCull (float cullDistance)
void trap_SetBrushModel (gentity_t *ent, const char *name)
void trap_Trace (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask)
void trap_G2Trace (trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int g2TraceType, int traceLod)
int trap_PointContents (const vec3_t point, int passEntityNum)
qboolean trap_InPVS (const vec3_t p1, const vec3_t p2)
qboolean trap_InPVSIgnorePortals (const vec3_t p1, const vec3_t p2)
void trap_AdjustAreaPortalState (gentity_t *ent, qboolean open)
qboolean trap_AreasConnected (int area1, int area2)
void trap_LinkEntity (gentity_t *ent)
void trap_UnlinkEntity (gentity_t *ent)
int trap_EntitiesInBox (const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount)
qboolean trap_EntityContact (const vec3_t mins, const vec3_t maxs, const gentity_t *ent)
int trap_BotAllocateClient (void)
void trap_BotFreeClient (int clientNum)
void trap_GetUsercmd (int clientNum, usercmd_t *cmd)
qboolean trap_GetEntityToken (char *buffer, int bufferSize)
void trap_SiegePersSet (siegePers_t *pers)
void trap_SiegePersGet (siegePers_t *pers)
int trap_DebugPolygonCreate (int color, int numPoints, vec3_t *points)
void trap_DebugPolygonDelete (int id)
int trap_BotLibSetup (void)
int trap_BotLibShutdown (void)
int trap_BotLibVarSet (char *var_name, char *value)
int trap_BotLibVarGet (char *var_name, char *value, int size)
int trap_BotLibDefine (char *string)
int trap_BotLibStartFrame (float time)
int trap_BotLibLoadMap (const char *mapname)
int trap_BotLibUpdateEntity (int ent, void *bue)
int trap_BotLibTest (int parm0, char *parm1, vec3_t parm2, vec3_t parm3)
int trap_BotGetSnapshotEntity (int clientNum, int sequence)
int trap_BotGetServerCommand (int clientNum, char *message, int size)
void trap_BotUserCommand (int client, usercmd_t *ucmd)
int trap_AAS_BBoxAreas (vec3_t absmins, vec3_t absmaxs, int *areas, int maxareas)
int trap_AAS_AreaInfo (int areanum, void *info)
void trap_AAS_EntityInfo (int entnum, void *info)
int trap_AAS_Initialized (void)
void trap_AAS_PresenceTypeBoundingBox (int presencetype, vec3_t mins, vec3_t maxs)
float trap_AAS_Time (void)
int trap_AAS_PointAreaNum (vec3_t point)
int trap_AAS_PointReachabilityAreaIndex (vec3_t point)
int trap_AAS_TraceAreas (vec3_t start, vec3_t end, int *areas, vec3_t *points, int maxareas)
int trap_AAS_PointContents (vec3_t point)
int trap_AAS_NextBSPEntity (int ent)
int trap_AAS_ValueForBSPEpairKey (int ent, char *key, char *value, int size)
int trap_AAS_VectorForBSPEpairKey (int ent, char *key, vec3_t v)
int trap_AAS_FloatForBSPEpairKey (int ent, char *key, float *value)
int trap_AAS_IntForBSPEpairKey (int ent, char *key, int *value)
int trap_AAS_AreaReachability (int areanum)
int trap_AAS_AreaTravelTimeToGoalArea (int areanum, vec3_t origin, int goalareanum, int travelflags)
int trap_AAS_EnableRoutingArea (int areanum, int enable)
int trap_AAS_PredictRoute (void *route, int areanum, vec3_t origin, int goalareanum, int travelflags, int maxareas, int maxtime, int stopevent, int stopcontents, int stoptfl, int stopareanum)
int trap_AAS_AlternativeRouteGoals (vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags, void *altroutegoals, int maxaltroutegoals, int type)
int trap_AAS_Swimming (vec3_t origin)
int trap_AAS_PredictClientMovement (void *move, int entnum, vec3_t origin, int presencetype, int onground, vec3_t velocity, vec3_t cmdmove, int cmdframes, int maxframes, float frametime, int stopevent, int stopareanum, int visualize)
void trap_EA_Say (int client, char *str)
void trap_EA_SayTeam (int client, char *str)
void trap_EA_Command (int client, char *command)
void trap_EA_Action (int client, int action)
void trap_EA_Gesture (int client)
void trap_EA_Talk (int client)
void trap_EA_Attack (int client)
void trap_EA_Use (int client)
void trap_EA_Respawn (int client)
void trap_EA_Crouch (int client)
void trap_EA_MoveUp (int client)
void trap_EA_MoveDown (int client)
void trap_EA_MoveForward (int client)
void trap_EA_MoveBack (int client)
void trap_EA_MoveLeft (int client)
void trap_EA_MoveRight (int client)
void trap_EA_SelectWeapon (int client, int weapon)
void trap_EA_Jump (int client)
void trap_EA_DelayedJump (int client)
void trap_EA_Move (int client, vec3_t dir, float speed)
void trap_EA_View (int client, vec3_t viewangles)
void trap_EA_Alt_Attack (int client)
void trap_EA_ForcePower (int client)
void trap_EA_EndRegular (int client, float thinktime)
void trap_EA_GetInput (int client, float thinktime, void *input)
void trap_EA_ResetInput (int client)
int trap_BotLoadCharacter (char *charfile, float skill)
void trap_BotFreeCharacter (int character)
float trap_Characteristic_Float (int character, int index)
float trap_Characteristic_BFloat (int character, int index, float min, float max)
int trap_Characteristic_Integer (int character, int index)
int trap_Characteristic_BInteger (int character, int index, int min, int max)
void trap_Characteristic_String (int character, int index, char *buf, int size)
int trap_BotAllocChatState (void)
void trap_BotFreeChatState (int handle)
void trap_BotQueueConsoleMessage (int chatstate, int type, char *message)
void trap_BotRemoveConsoleMessage (int chatstate, int handle)
int trap_BotNextConsoleMessage (int chatstate, void *cm)
int trap_BotNumConsoleMessages (int chatstate)
void trap_BotInitialChat (int chatstate, char *type, int mcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7)
int trap_BotNumInitialChats (int chatstate, char *type)
int trap_BotReplyChat (int chatstate, char *message, int mcontext, int vcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7)
int trap_BotChatLength (int chatstate)
void trap_BotEnterChat (int chatstate, int client, int sendto)
void trap_BotGetChatMessage (int chatstate, char *buf, int size)
int trap_StringContains (char *str1, char *str2, int casesensitive)
int trap_BotFindMatch (char *str, void *match, unsigned long int context)
void trap_BotMatchVariable (void *match, int variable, char *buf, int size)
void trap_UnifyWhiteSpaces (char *string)
void trap_BotReplaceSynonyms (char *string, unsigned long int context)
int trap_BotLoadChatFile (int chatstate, char *chatfile, char *chatname)
void trap_BotSetChatGender (int chatstate, int gender)
void trap_BotSetChatName (int chatstate, char *name, int client)
void trap_BotResetGoalState (int goalstate)
void trap_BotRemoveFromAvoidGoals (int goalstate, int number)
void trap_BotResetAvoidGoals (int goalstate)
void trap_BotPushGoal (int goalstate, void *goal)
void trap_BotPopGoal (int goalstate)
void trap_BotEmptyGoalStack (int goalstate)
void trap_BotDumpAvoidGoals (int goalstate)
void trap_BotDumpGoalStack (int goalstate)
void trap_BotGoalName (int number, char *name, int size)
int trap_BotGetTopGoal (int goalstate, void *goal)
int trap_BotGetSecondGoal (int goalstate, void *goal)
int trap_BotChooseLTGItem (int goalstate, vec3_t origin, int *inventory, int travelflags)
int trap_BotChooseNBGItem (int goalstate, vec3_t origin, int *inventory, int travelflags, void *ltg, float maxtime)
int trap_BotTouchingGoal (vec3_t origin, void *goal)
int trap_BotItemGoalInVisButNotVisible (int viewer, vec3_t eye, vec3_t viewangles, void *goal)
int trap_BotGetNextCampSpotGoal (int num, void *goal)
int trap_BotGetMapLocationGoal (char *name, void *goal)
int trap_BotGetLevelItemGoal (int index, char *classname, void *goal)
float trap_BotAvoidGoalTime (int goalstate, int number)
void trap_BotSetAvoidGoalTime (int goalstate, int number, float avoidtime)
void trap_BotInitLevelItems (void)
void trap_BotUpdateEntityItems (void)
int trap_BotLoadItemWeights (int goalstate, char *filename)
void trap_BotFreeItemWeights (int goalstate)
void trap_BotInterbreedGoalFuzzyLogic (int parent1, int parent2, int child)
void trap_BotSaveGoalFuzzyLogic (int goalstate, char *filename)
void trap_BotMutateGoalFuzzyLogic (int goalstate, float range)
int trap_BotAllocGoalState (int state)
void trap_BotFreeGoalState (int handle)
void trap_BotResetMoveState (int movestate)
void trap_BotMoveToGoal (void *result, int movestate, void *goal, int travelflags)
int trap_BotMoveInDirection (int movestate, vec3_t dir, float speed, int type)
void trap_BotResetAvoidReach (int movestate)
void trap_BotResetLastAvoidReach (int movestate)
int trap_BotReachabilityArea (vec3_t origin, int testground)
int trap_BotMovementViewTarget (int movestate, void *goal, int travelflags, float lookahead, vec3_t target)
int trap_BotPredictVisiblePosition (vec3_t origin, int areanum, void *goal, int travelflags, vec3_t target)
int trap_BotAllocMoveState (void)
void trap_BotFreeMoveState (int handle)
void trap_BotInitMoveState (int handle, void *initmove)
void trap_BotAddAvoidSpot (int movestate, vec3_t origin, float radius, int type)
int trap_BotChooseBestFightWeapon (int weaponstate, int *inventory)
void trap_BotGetWeaponInfo (int weaponstate, int weapon, void *weaponinfo)
int trap_BotLoadWeaponWeights (int weaponstate, char *filename)
int trap_BotAllocWeaponState (void)
void trap_BotFreeWeaponState (int weaponstate)
void trap_BotResetWeaponState (int weaponstate)
int trap_GeneticParentsAndChildSelection (int numranks, float *ranks, int *parent1, int *parent2, int *child)
void trap_SnapVector (float *v)
int trap_SP_GetStringTextString (const char *text, char *buffer, int bufferLength)
qboolean trap_ROFF_Clean (void)
void trap_ROFF_UpdateEntities (void)
int trap_ROFF_Cache (char *file)
qboolean trap_ROFF_Play (int entID, int roffID, qboolean doTranslation)
qboolean trap_ROFF_Purge_Ent (int entID)
void trap_TrueMalloc (void **ptr, int size)
void trap_TrueFree (void **ptr)
int trap_ICARUS_RunScript (gentity_t *ent, const char *name)
qboolean trap_ICARUS_RegisterScript (const char *name, qboolean bCalledDuringInterrogate)
void trap_ICARUS_Init (void)
qboolean trap_ICARUS_ValidEnt (gentity_t *ent)
qboolean trap_ICARUS_IsInitialized (int entID)
qboolean trap_ICARUS_MaintainTaskManager (int entID)
qboolean trap_ICARUS_IsRunning (int entID)
qboolean trap_ICARUS_TaskIDPending (gentity_t *ent, int taskID)
void trap_ICARUS_InitEnt (gentity_t *ent)
void trap_ICARUS_FreeEnt (gentity_t *ent)
void trap_ICARUS_AssociateEnt (gentity_t *ent)
void trap_ICARUS_Shutdown (void)
void trap_ICARUS_TaskIDSet (gentity_t *ent, int taskType, int taskID)
void trap_ICARUS_TaskIDComplete (gentity_t *ent, int taskType)
void trap_ICARUS_SetVar (int taskID, int entID, const char *type_name, const char *data)
int trap_ICARUS_VariableDeclared (const char *type_name)
int trap_ICARUS_GetFloatVariable (const char *name, float *value)
int trap_ICARUS_GetStringVariable (const char *name, const char *value)
int trap_ICARUS_GetVectorVariable (const char *name, const vec3_t value)
void trap_Nav_Init (void)
void trap_Nav_Free (void)
qboolean trap_Nav_Load (const char *filename, int checksum)
qboolean trap_Nav_Save (const char *filename, int checksum)
int trap_Nav_AddRawPoint (vec3_t point, int flags, int radius)
void trap_Nav_CalculatePaths (qboolean recalc)
void trap_Nav_HardConnect (int first, int second)
void trap_Nav_ShowNodes (void)
void trap_Nav_ShowEdges (void)
void trap_Nav_ShowPath (int start, int end)
int trap_Nav_GetNearestNode (gentity_t *ent, int lastID, int flags, int targetID)
int trap_Nav_GetBestNode (int startID, int endID, int rejectID)
int trap_Nav_GetNodePosition (int nodeID, vec3_t out)
int trap_Nav_GetNodeNumEdges (int nodeID)
int trap_Nav_GetNodeEdge (int nodeID, int edge)
int trap_Nav_GetNumNodes (void)
qboolean trap_Nav_Connected (int startID, int endID)
int trap_Nav_GetPathCost (int startID, int endID)
int trap_Nav_GetEdgeCost (int startID, int endID)
int trap_Nav_GetProjectedNode (vec3_t origin, int nodeID)
void trap_Nav_CheckFailedNodes (gentity_t *ent)
void trap_Nav_AddFailedNode (gentity_t *ent, int nodeID)
qboolean trap_Nav_NodeFailed (gentity_t *ent, int nodeID)
qboolean trap_Nav_NodesAreNeighbors (int startID, int endID)
void trap_Nav_ClearFailedEdge (failedEdge_t *failedEdge)
void trap_Nav_ClearAllFailedEdges (void)
int trap_Nav_EdgeFailed (int startID, int endID)
void trap_Nav_AddFailedEdge (int entID, int startID, int endID)
qboolean trap_Nav_CheckFailedEdge (failedEdge_t *failedEdge)
void trap_Nav_CheckAllFailedEdges (void)
qboolean trap_Nav_RouteBlocked (int startID, int testEdgeID, int endID, int rejectRank)
int trap_Nav_GetBestNodeAltRoute (int startID, int endID, int *pathCost, int rejectID)
int trap_Nav_GetBestNodeAltRoute2 (int startID, int endID, int rejectID)
int trap_Nav_GetBestPathBetweenEnts (gentity_t *ent, gentity_t *goal, int flags)
int trap_Nav_GetNodeRadius (int nodeID)
void trap_Nav_CheckBlockedEdges (void)
void trap_Nav_ClearCheckedNodes (void)
int trap_Nav_CheckedNode (int wayPoint, int ent)
void trap_Nav_SetCheckedNode (int wayPoint, int ent, int value)
void trap_Nav_FlagAllNodes (int newFlag)
qboolean trap_Nav_GetPathsCalculated (void)
void trap_Nav_SetPathsCalculated (qboolean newVal)
void trap_SV_RegisterSharedMemory (char *memory)
void trap_SetActiveSubBSP (int index)
int trap_CM_RegisterTerrain (const char *config)
void trap_RMG_Init (int terrainID)
void trap_Bot_UpdateWaypoints (int wpnum, wpobject_t **wps)
void trap_Bot_CalculatePaths (int rmg)

Variables

int gPainMOD
int gPainHitLoc
vec3_t gPainPoint
char gSharedBuffer [MAX_G_SHARED_BUFFER_SIZE]
void * precachedKyle
void * g2SaberInstance
qboolean gEscaping
int gEscapeTime
int gGAvoidDismember
int BMS_START
int BMS_MID
int BMS_END
gentity_tgJMSaberEnt
vmCvar_t g_ff_objectives
qboolean gDoSlowMoDuel
int gSlowMoDuelTime
level_locals_t level
gentity_t g_entities [MAX_GENTITIES]
vmCvar_t g_gametype
vmCvar_t g_dedicated
vmCvar_t g_developer
vmCvar_t g_cheats
vmCvar_t g_maxclients
vmCvar_t g_maxGameClients
vmCvar_t g_restarted
vmCvar_t g_trueJedi
vmCvar_t g_autoMapCycle
vmCvar_t g_dmflags
vmCvar_t g_maxForceRank
vmCvar_t g_forceBasedTeams
vmCvar_t g_privateDuel
vmCvar_t g_allowNPC
vmCvar_t g_armBreakage
vmCvar_t g_saberLocking
vmCvar_t g_saberLockFactor
vmCvar_t g_saberTraceSaberFirst
vmCvar_t d_saberKickTweak
vmCvar_t d_powerDuelPrint
vmCvar_t d_saberGhoul2Collision
vmCvar_t g_saberBladeFaces
vmCvar_t d_saberAlwaysBoxTrace
vmCvar_t d_saberBoxTraceSize
vmCvar_t d_siegeSeekerNPC
vmCvar_t g_debugMelee
vmCvar_t g_stepSlideFix
vmCvar_t g_noSpecMove
vmCvar_t d_perPlayerGhoul2
vmCvar_t d_projectileGhoul2Collision
vmCvar_t g_g2TraceLod
vmCvar_t g_optvehtrace
vmCvar_t g_locationBasedDamage
vmCvar_t g_allowHighPingDuelist
vmCvar_t g_logClientInfo
vmCvar_t g_slowmoDuelEnd
vmCvar_t g_saberDamageScale
vmCvar_t g_useWhileThrowing
vmCvar_t g_RMG
vmCvar_t g_svfps
vmCvar_t g_forceRegenTime
vmCvar_t g_spawnInvulnerability
vmCvar_t g_forcePowerDisable
vmCvar_t g_weaponDisable
vmCvar_t g_allowDuelSuicide
vmCvar_t g_fraglimitVoteCorrection
vmCvar_t g_duelWeaponDisable
vmCvar_t g_fraglimit
vmCvar_t g_duel_fraglimit
vmCvar_t g_timelimit
vmCvar_t g_capturelimit
vmCvar_t d_saberInterpolate
vmCvar_t g_friendlyFire
vmCvar_t g_friendlySaber
vmCvar_t g_password
vmCvar_t g_needpass
vmCvar_t g_gravity
vmCvar_t g_speed
vmCvar_t g_knockback
vmCvar_t g_quadfactor
vmCvar_t g_forcerespawn
vmCvar_t g_siegeRespawn
vmCvar_t g_inactivity
vmCvar_t g_debugMove
vmCvar_t g_debugAlloc
vmCvar_t g_debugDamage
vmCvar_t g_debugServerSkel
vmCvar_t g_weaponRespawn
vmCvar_t g_weaponTeamRespawn
vmCvar_t g_adaptRespawn
vmCvar_t g_synchronousClients
vmCvar_t g_motd
vmCvar_t g_warmup
vmCvar_t g_doWarmup
vmCvar_t g_blood
vmCvar_t g_allowVote
vmCvar_t g_teamAutoJoin
vmCvar_t g_teamForceBalance
vmCvar_t g_banIPs
vmCvar_t g_filterBan
vmCvar_t g_debugForward
vmCvar_t g_debugRight
vmCvar_t g_debugUp
vmCvar_t g_smoothClients
vmCvar_t pmove_fixed
vmCvar_t pmove_msec
vmCvar_t g_enableBreath
vmCvar_t g_singlePlayer
vmCvar_t g_dismember
vmCvar_t g_forceDodge
vmCvar_t g_timeouttospec
vmCvar_t g_saberDmgVelocityScale
vmCvar_t g_saberDmgDelay_Idle
vmCvar_t g_saberDmgDelay_Wound
vmCvar_t g_saberDebugPrint
vmCvar_t g_siegeTeamSwitch
vmCvar_t bg_fighterAltControl
vmCvar_t g_saberDebugBox
vmCvar_t d_altRoutes
vmCvar_t d_patched
vmCvar_t d_noIntermissionWait
vmCvar_t g_siegeTeam1
vmCvar_t g_siegeTeam2
vmCvar_t g_austrian
vmCvar_t g_powerDuelStartHealth
vmCvar_t g_powerDuelEndHealth
vmCvar_t g_showDuelHealths


Define Documentation

#define BODY_QUEUE_SIZE   8
 

Definition at line 31 of file g_local.h.

Referenced by InitBodyQue().

#define CARNAGE_REWARD_TIME   3000
 

Definition at line 38 of file g_local.h.

Referenced by player_die().

#define DAMAGE_DEATH_KNOCKBACK   0x00000080
 

Definition at line 1170 of file g_local.h.

Referenced by DEMP2_AltRadiusDamage(), EWebFire(), ImperialProbe_FireBlaster(), Mark1_FireBlaster(), Mark1_FireRocket(), Mark1Dead_FireBlaster(), Mark1Dead_FireRocket(), Mark2_FireBlaster(), Remote_Fire(), Seeker_Fire(), Sentry_Fire(), WP_FireBlasterMissile(), WP_FireEmplacedMissile(), WP_FireGenericBlasterMissile(), WP_FireTurboLaserMissile(), WP_FireTurretMissile(), and WP_FireVehicleWeapon().

#define DAMAGE_EXTRA_KNOCKBACK   0x00000040
 

Definition at line 1169 of file g_local.h.

#define DAMAGE_HALF_ABSORB   0x00000400
 

Definition at line 1173 of file g_local.h.

Referenced by CheckArmor(), G_MissileImpact(), and WP_FireStunBaton().

#define DAMAGE_HALF_ARMOR_REDUCTION   0x00000800
 

Definition at line 1174 of file g_local.h.

Referenced by CheckArmor().

#define DAMAGE_HEAVY_WEAP_CLASS   0x00001000
 

Definition at line 1175 of file g_local.h.

Referenced by G_MissileImpact(), and WP_FireEmplacedMissile().

#define DAMAGE_IGNORE_TEAM   0x00000100
 

Definition at line 1171 of file g_local.h.

Referenced by Boba_FireFlameThrower().

#define DAMAGE_NO_ARMOR   0x00000002
 

Definition at line 1164 of file g_local.h.

Referenced by Boba_FireFlameThrower(), CheckArmor(), ClientEvents(), ClientThink_real(), DoGripAction(), DoImpact(), G_RunFrame(), NPC_BSGM_Attack(), P_WorldEffects(), PM_VehicleImpact(), Rancor_Attack(), Rancor_Bite(), Rancor_Smash(), Rancor_Swing(), Wampa_Slash(), and WP_FireMelee().

#define DAMAGE_NO_DAMAGE   0x00000200
 

Definition at line 1172 of file g_local.h.

#define DAMAGE_NO_DISMEMBER   0x00008000
 

Definition at line 1178 of file g_local.h.

Referenced by G_Damage(), and WP_SaberApplyDamage().

#define DAMAGE_NO_HIT_LOC   0x00002000
 

Definition at line 1176 of file g_local.h.

Referenced by G_Damage(), G_LocationBasedDamageModifier(), and Rancor_Attack().

#define DAMAGE_NO_KNOCKBACK   0x00000004
 

Definition at line 1165 of file g_local.h.

Referenced by Boba_FireFlameThrower(), G_Damage(), G_TryPushingEntity(), Howler_TryDamage(), Interrogator_Melee(), MineMonster_TryDamage(), NPC_BSGM_Attack(), Rancor_Attack(), Rancor_Bite(), Rancor_Smash(), Rancor_Swing(), target_laser_think(), Wampa_Slash(), WP_DisruptorAltFire(), WP_FireStunBaton(), and WP_SaberRadiusDamage().

#define DAMAGE_NO_PROTECTION   0x00000008
 

Definition at line 1166 of file g_local.h.

Referenced by ClientThink_real(), Cmd_DuelTeam_f(), G_Damage(), G_KillBox(), hurt_touch(), hyperspace_touch(), NPC_BSSeeker_Default(), NPC_Mark2_Pain(), player_die(), Rancor_Attack(), shipboundary_touch(), and target_kill_use().

#define DAMAGE_NO_SELF_PROTECTION   0x00004000
 

Definition at line 1177 of file g_local.h.

Referenced by G_Damage().

#define DAMAGE_NO_TEAM_PROTECTION   0x00000010
 

Definition at line 1167 of file g_local.h.

#define DAMAGE_NORMAL   0x00000000
 

Definition at line 1162 of file g_local.h.

#define DAMAGE_RADIUS   0x00000001
 

Definition at line 1163 of file g_local.h.

Referenced by G_Damage(), and G_RadiusDamage().

#define DAMAGE_SABER_KNOCKBACK1   0x00010000
 

Definition at line 1179 of file g_local.h.

Referenced by G_Damage().

#define DAMAGE_SABER_KNOCKBACK1_B2   0x00040000
 

Definition at line 1181 of file g_local.h.

Referenced by G_Damage().

#define DAMAGE_SABER_KNOCKBACK2   0x00020000
 

Definition at line 1180 of file g_local.h.

Referenced by G_Damage().

#define DAMAGE_SABER_KNOCKBACK2_B2   0x00080000
 

Definition at line 1182 of file g_local.h.

Referenced by G_Damage().

#define DAMAGEREDIRECT_HEAD   1
 

Definition at line 362 of file g_local.h.

#define DAMAGEREDIRECT_LLEG   3
 

Definition at line 364 of file g_local.h.

#define DAMAGEREDIRECT_RLEG   2
 

Definition at line 363 of file g_local.h.

#define DEBUG_SABER_BOX
 

Definition at line 82 of file g_local.h.

#define FL_BBRUSH   0x04000000
 

Definition at line 79 of file g_local.h.

Referenced by charge_stick(), Client_CheckImpactBBrush(), DoImpact(), and G_Damage().

#define FL_BOUNCE   0x00100000
 

Definition at line 68 of file g_local.h.

Referenced by G_MissileImpact(), and G_RunObject().

#define FL_BOUNCE_HALF   0x00200000
 

Definition at line 69 of file g_local.h.

Referenced by CreateLaserTrap(), G_BounceMissile(), G_BounceObject(), G_MissileImpact(), G_RunMissile(), G_RunObject(), LaunchItem(), MakeDeadSaber(), saberKnockDown(), SP_info_jedimaster_start(), SP_misc_holocron(), WP_FireThermalDetonator(), and WP_SaberStartMissileBlockCheck().

#define FL_BOUNCE_SHRAPNEL   0x00400000
 

Definition at line 70 of file g_local.h.

Referenced by G_BounceMissile(), and G_MissileImpact().

#define FL_DMG_BY_HEAVY_WEAP_ONLY   0x02000000
 

Definition at line 77 of file g_local.h.

Referenced by G_Damage(), G_MissileImpact(), NPC_Spawn_Do(), and SP_func_breakable().

#define FL_DMG_BY_SABER_ONLY   0x01000000
 

Definition at line 76 of file g_local.h.

Referenced by G_Damage(), and SP_func_breakable().

#define FL_DONT_SHOOT   0x00040000
 

Definition at line 63 of file g_local.h.

Referenced by NPC_ExecuteBState().

#define FL_DROPPED_ITEM   0x00001000
 

Definition at line 57 of file g_local.h.

Referenced by CheckAlmostCapture(), CheckItemCanBePickedUpByNPC(), CTFFlagMovement(), CTFTakesPriority(), LaunchItem(), Pickup_Weapon(), Team_FragBonuses(), Team_ResetFlag(), Team_TouchOurFlag(), and Touch_Item().

#define FL_FORCE_GESTURE   0x00008000
 

Definition at line 60 of file g_local.h.

Referenced by ClientThink_real(), and Team_ForceGesture().

#define FL_GODMODE   0x00000010
 

Definition at line 53 of file g_local.h.

Referenced by ClientCommand(), Cmd_God_f(), Cmd_Kill_f(), Cmd_SiegeClass_f(), G_Damage(), P_DamageFeedback(), Q3_GetFloat(), and SetTeam().

#define FL_INACTIVE   0x00010000
 

Definition at line 61 of file g_local.h.

Referenced by G_EntIsUnlockedDoor(), G_SetActiveState(), GlobalUse(), hurt_touch(), InitMover(), InitTrigger(), maglock_die(), maglock_link(), multi_trigger(), SP_target_relay(), SP_target_scriptrunner(), target_counter_use(), target_relay_use(), Touch_DoorTrigger(), Touch_Multi(), trigger_push_touch(), trigger_teleporter_touch(), Use_BinaryMover(), and ValidUseTarget().

#define FL_NAVGOAL   0x00020000
 

Definition at line 62 of file g_local.h.

Referenced by NAV_ClearPathToPoint(), NPC_ClearPathToGoal(), NPC_SetMoveGoal(), and ST_TransferMoveGoal().

#define FL_NO_BOTS   0x00002000
 

Definition at line 58 of file g_local.h.

Referenced by ClientSpawn(), SP_info_player_deathmatch(), SP_info_player_duel(), SP_info_player_duel1(), and SP_info_player_duel2().

#define FL_NO_HUMANS   0x00004000
 

Definition at line 59 of file g_local.h.

Referenced by ClientSpawn(), SP_info_player_deathmatch(), SP_info_player_duel(), SP_info_player_duel1(), and SP_info_player_duel2().

#define FL_NO_KNOCKBACK   0x00000800
 

Definition at line 56 of file g_local.h.

Referenced by G_Damage(), NPC_BSJump(), NPC_GalakMech_Init(), NPC_SetMiscDefaultData(), NPC_Spawn_Do(), Q3_GetFloat(), Q3_Kill(), and WP_SaberRadiusDamage().

#define FL_NOTARGET   0x00000020
 

Definition at line 54 of file g_local.h.

Referenced by Cmd_Notarget_f(), G_SetEnemy(), Jedi_Cloak(), Jedi_Decloak(), NPC_Begin(), NPC_BSFollowLeader(), NPC_CheckCanAttack(), NPC_CheckEnemy(), NPC_CheckEnemyStealth(), NPC_CheckInvestigate(), NPC_CheckPossibleEnemy(), NPC_Pain(), NPC_PickEnemy(), NPC_Rancor_Pain(), NPC_Spawn_Do(), NPC_Touch(), NPC_ValidEnemy(), NPC_Wampa_Pain(), Q3_GetFloat(), turret_base_think(), turretG2_base_think(), and ValidEnemy().

#define FL_SHIELDED   0x00080000
 

Definition at line 64 of file g_local.h.

Referenced by G_Damage(), G_DriveATST(), G_MissileImpact(), maglock_link(), Mark2_AttackDecision(), NPC_BSGM_Default(), NPC_GalakMech_Init(), NPC_Sentry_Pain(), NPC_SetMiscDefaultData(), NPC_Spawn_Do(), Sentry_Fire(), Sentry_Idle(), Sentry_RangedAttack(), sentry_use(), and WP_DisruptorAltFire().

#define FL_TEAMSLAVE   0x00000400
 

Definition at line 55 of file g_local.h.

Referenced by FinishSpawningItem(), G_EntIsUnlockedDoor(), G_FindDoorTrigger(), G_FindTeams(), G_RunMover(), SP_func_door(), Touch_DoorTrigger(), and Use_BinaryMover().

#define FL_UNDYING   0x00100000
 

Definition at line 65 of file g_local.h.

Referenced by G_Damage(), G_EjectDroidUnit(), NPC_Begin(), and player_die().

#define FL_VEH_BOARDING   0x00800000
 

Definition at line 73 of file g_local.h.

#define FOFS  )     ((int)&(((gentity_t *)0)->x))
 

Definition at line 1503 of file g_local.h.

Referenced by asteroid_pick_random_asteroid(), BlowDetpacks(), BotCheckDetPacks(), CheckAlmostCapture(), ClientCommand(), Cmd_NPC_f(), FindIntermissionPoint(), fx_runner_link(), G_EntIsUnlockedDoor(), G_FindDoorTrigger(), G_PickTarget(), G_RMGPathing(), G_SetActiveState(), G_UseTargets2(), GetObjectThatTargets(), hyperspace_touch(), misc_weapon_shooter_aim(), NPC_ShowDebugInfo(), Q3_Kill(), Q3_Remove(), Q3_SetICARUSFreeze(), ref_link(), SelectDuelSpawnPoint(), SelectInitialSpawnPoint(), SelectNearestDeathmatchSpawnPoint(), SelectRandomDeathmatchSpawnPoint(), SelectRandomFurthestSpawnPoint(), SelectRandomTeamSpawnPoint(), shipboundary_touch(), SiegeItemUse(), target_laser_start(), target_random_use(), Team_FragBonuses(), Team_ResetFlag(), Think_SetupTrainTargets(), Use_Target_Give(), UseSiegeTarget(), WP_DropDetPack(), and WP_PlaceLaserTrap().

#define FOLLOW_ACTIVE1   -1
 

Definition at line 405 of file g_local.h.

#define FOLLOW_ACTIVE2   -2
 

Definition at line 406 of file g_local.h.

#define FRAMETIME   100
 

Definition at line 37 of file g_local.h.

Referenced by AI_RefreshGroup(), drop_charge(), finish_spawning_turretG2(), ForceJump(), ForceJumpCharge(), func_wait_return_solid(), G_Dismember(), G_RunObject(), G_SpawnItem(), G_StartObjectMoving(), GM_Dying(), hurt_touch(), laserTrapDelayedExplode(), laserTrapThink(), misc_weapon_shooter_aim(), MoveOwner(), NAV_ClearPathToPoint(), NAV_TrueCollision(), NPC_Begin(), NPC_BSRemove(), NPC_RemoveBody(), NPC_Spawn_Do(), NPC_SpawnType(), NPC_Think(), pas_think(), SiegeItemThink(), SiegeItemUse(), SolidifyOwner(), SP_func_door(), SP_func_timer(), SP_func_train(), SP_misc_siege_item(), SP_misc_turret(), SP_PAS(), SP_target_laser(), SP_target_push(), SP_trigger_multiple(), SP_trigger_push(), target_laser_think(), target_relay_use(), touchLaserTrap(), turret_base_think(), turretG2_base_think(), Use_BinaryMover_Go(), and WP_SaberPositionUpdate().

#define GAME_INLINE   ID_INLINE
 

Definition at line 11 of file g_local.h.

Referenced by AddPassenger(), Inhabited(), SetParent(), SetPilot(), and VectorCompare2().

#define GAMEVERSION   "basejka_mod"
 

Definition at line 29 of file g_local.h.

Referenced by G_InitGame().

#define INFINITE   1000000
 

Definition at line 34 of file g_local.h.

#define INTERMISSION_DELAY_TIME   1000
 

Definition at line 41 of file g_local.h.

Referenced by CheckExitRules().

#define MAX_ALERT_EVENTS   32
 

Definition at line 769 of file g_local.h.

Referenced by AddSightEvent(), AddSoundEvent(), ClearPlayerAlertEvents(), and RemoveOldestAlert().

#define MAX_COMBAT_POINTS   512
 

Definition at line 754 of file g_local.h.

Referenced by NPC_FindCombatPoint(), and SP_point_combat().

#define MAX_FILEPATH   144
 

Definition at line 1472 of file g_local.h.

#define MAX_G_SHARED_BUFFER_SIZE   8192
 

Definition at line 85 of file g_local.h.

#define MAX_INTEREST_POINTS   64
 

Definition at line 744 of file g_local.h.

Referenced by SP_target_interest().

#define MAX_NETNAME   36
 

Definition at line 435 of file g_local.h.

Referenced by Cmd_CallTeamVote_f().

#define MAX_REFNAME   32
 

Definition at line 1226 of file g_local.h.

Referenced by TAG_Add().

#define MAX_VOTE_COUNT   3
 

Definition at line 436 of file g_local.h.

Referenced by Cmd_CallTeamVote_f(), and Cmd_CallVote_f().

#define PSG_TEAMVOTED   (1<<1)
 

Definition at line 432 of file g_local.h.

Referenced by ClientSpawn(), Cmd_CallTeamVote_f(), and Cmd_TeamVote_f().

#define PSG_VOTED   (1<<0)
 

Definition at line 431 of file g_local.h.

Referenced by ClientSpawn(), Cmd_CallVote_f(), and Cmd_Vote_f().

#define REWARD_SPRITE_TIME   2000
 

Definition at line 39 of file g_local.h.

Referenced by player_die(), Team_FragBonuses(), and Team_TouchOurFlag().

#define RTF_NAVGOAL   0x00000001
 

Definition at line 1230 of file g_local.h.

Referenced by NAV_ShowDebugInfo(), SP_waypoint_navgoal(), SP_waypoint_navgoal_1(), SP_waypoint_navgoal_2(), SP_waypoint_navgoal_4(), and SP_waypoint_navgoal_8().

#define RTF_NONE   0
 

Definition at line 1229 of file g_local.h.

#define SP_INTERMISSION_DELAY_TIME   5000
 

Definition at line 42 of file g_local.h.

#define SP_PODIUM_MODEL   "models/mapobjects/podium/podium4.md3"
 

Definition at line 96 of file g_local.h.

Referenced by G_InitGame().

#define SPF_BUTTON_FPUSHABLE   2
 

Definition at line 1211 of file g_local.h.

Referenced by ForceThrow().

#define SPF_BUTTON_USABLE   1
 

Definition at line 1210 of file g_local.h.

#define START_TIME_FIND_LINKS   FRAMETIME*2
 

Definition at line 46 of file g_local.h.

Referenced by SP_misc_maglock().

#define START_TIME_FIND_WAYPOINT   FRAMETIME*5
 

Definition at line 50 of file g_local.h.

#define START_TIME_LINK_ENTS   FRAMETIME*1
 

Definition at line 1227 of file g_local.h.

#define START_TIME_LINK_ENTS   FRAMETIME*1
 

Definition at line 1227 of file g_local.h.

Referenced by SP_misc_weapon_shooter(), and SP_reference_tag().

#define START_TIME_MOVERS_SPAWNED   FRAMETIME*2
 

Definition at line 47 of file g_local.h.

#define START_TIME_NAV_CALC   FRAMETIME*4
 

Definition at line 49 of file g_local.h.

Referenced by G_InitGame().

#define START_TIME_REMOVE_ENTS   FRAMETIME*3
 

Definition at line 48 of file g_local.h.

Referenced by SP_NPC_spawner().


Typedef Documentation

typedef struct alertEvent_s alertEvent_t
 

Referenced by ClearPlayerAlertEvents(), NPC_PickEnemyExt(), and RemoveOldestAlert().

typedef struct bot_settings_s bot_settings_t
 

Referenced by BotAISetupClient(), BotResetState(), and G_BotConnect().

typedef int clientConnected_t
 

Definition at line 371 of file g_local.h.

typedef struct gclient_s gclient_t
 

Definition at line 17 of file g_local.h.

Referenced by AddPowerDuelPlayers(), AddTournamentPlayer(), BotDamageNotification(), BroadcastTeamChange(), CalculateRanks(), CheckArmor(), CheckExitRules(), CheckIntermissionExit(), ClientBegin(), ClientConnect(), ClientEvents(), ClientForString(), ClientInactivityTimer(), ClientIntermissionThink(), ClientNumberFromString(), ClientSpawn(), ClientThink_real(), ClientTimerActions(), ClientUserinfoChanged(), DeathmatchScoreboardMessage(), DuelLimitHit(), DuelResetWinsLosses(), ExitLevel(), G_AddRandomBot(), G_ClientForShooter(), G_ClientNumberFromName(), G_ClientNumberFromStrippedName(), G_CountBotPlayers(), G_CountHumanPlayers(), G_CreateFakeClient(), G_Damage(), G_FreeClientForShooter(), G_FreeFakeClient(), G_GetDuelWinner(), G_InitSessionData(), G_KickAllBots(), G_PowerDuelCount(), G_ReadSessionData(), G_RemoveRandomBot(), G_WriteClientSessionData(), LogExit(), NPC_Begin(), P_DamageFeedback(), P_SetTwitchInfo(), Pickup_Powerup(), Pickup_Team(), player_die(), RemovePowerDuelLosers(), SetTeam(), SiegeTakesPriority(), SortRanks(), SpectatorClientEndFrame(), SpectatorThink(), Svcmd_ForceTeam_f(), Team_TouchEnemyFlag(), Team_TouchOurFlag(), and WP_SetSaberModel().

typedef struct gentity_s gentity_t
 

Definition at line 16 of file g_local.h.

Referenced by AcceptBotCommand(), Add_Ammo(), AddScore(), AddSiegeWinningTeamPoints(), AddSightEvent(), AddSoundEvent(), AddTeamScore(), AI_CheckEnemyCollision(), AI_DeleteSelfFromGroup(), AI_DistributeAttack(), AI_FindSelfInPreviousGroup(), AI_GetGroup(), AI_GetGroupSize(), AI_GetGroupSize2(), AI_GetNextEmptyGroup(), AI_GroupMemberKilled(), AI_GroupUpdateSquadstates(), AI_InsertGroupMember(), AI_RefreshGroup(), AI_SetNewGroupCommander(), AI_TryJoinPreviousGroup(), AI_ValidateGroupMember(), AI_ValidateNoEnemyGroupMember(), AimAtTarget(), ammo_generic_power_converter_use(), ammo_power_converter_use(), anglerCallback(), AnimateRiders(), asteroid_count_num_asteroids(), asteroid_field_think(), asteroid_pick_random_asteroid(), auto_turret_die(), BeamOut(), BeginAutoPathRoutine(), BeginIntermission(), BG_MySaber(), BG_ParseField(), BG_VehTraceFromCamPos(), Blocked_Door(), Blocked_Mover(), BlowDetpacks(), Board(), Boba_DoFlameThrower(), Boba_FireDecide(), Boba_FireFlameThrower(), Boba_Flying(), Boba_FlyStart(), Boba_FlyStop(), Boba_StartFlameThrower(), Boba_StopKnockdown(), body_die(), BodyRemovalPadTime(), BodyRid(), BodySink(), BotAI_GetClientState(), BotAI_GetEntityState(), BotCanHear(), BotCheckDetPacks(), BotDamageNotification(), BotDoChat(), BotGetFlagBack(), BotGuardFlagCarrier(), BotHasAssociated(), BotOrder(), BotScanForLeader(), BotStraightTPOrderCheck(), bottom_die(), BotWaypointRender(), CalcEntitySpot(), CalcMuzzlePoint(), CalcMuzzlePointOrigin(), CalcTeamDoorCenter(), CalculateAwards(), CalculateDemolitionist(), CalculateEfficiency(), CalculateLogistics(), CalculateSection31Award(), CalculateSharpshooter(), CalculateSiegeGoals(), CalculateStreak(), CalculateTactician(), CalculateTeamAward(), CalculateTeamCarrier(), CalculateTeamDefender(), CalculateTeamInterceptor(), CalculateTeamMVP(), CalculateTeamMVPByRank(), CalculateTeamRedShirt(), CalculateTeamWarrior(), CalculateUntouchable(), CalculateWeightGoals(), CanCounterThrow(), CanDamage(), CanSee(), CanShoot(), ChangeWeapon(), charge_stick(), CheatsOk(), check_recharge(), CheckAlmostCapture(), CheckArmor(), CheckForFriendInLOF(), CheckForFunc(), CheckItemCanBePickedUpByNPC(), CheckTeamStatus(), CheckTournament(), Client_CheckImpactBBrush(), ClientBegin(), ClientCommand(), ClientConnect(), ClientDisconnect(), ClientEndFrame(), ClientEvents(), ClientImpacts(), ClientNumberFromString(), ClientSpawn(), ClientThink(), ClientThink_real(), ClientTimerActions(), ClientUserinfoChanged(), Cmd_CallTeamVote_f(), Cmd_CallVote_f(), Cmd_DebugSetBodyAnim_f(), Cmd_DebugSetSaberMove_f(), Cmd_DuelTeam_f(), Cmd_EngageDuel_f(), Cmd_Follow_f(), Cmd_FollowCycle_f(), Cmd_ForceChanged_f(), Cmd_GameCommand_f(), Cmd_Give_f(), Cmd_God_f(), Cmd_Kill_f(), Cmd_LevelShot_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_NPC_f(), Cmd_SaberAttackCycle_f(), Cmd_Score_f(), Cmd_SetViewpos_f(), Cmd_SiegeClass_f(), Cmd_Stats_f(), Cmd_Team_f(), Cmd_TeamTask_f(), Cmd_TeamVote_f(), Cmd_ToggleSaber_f(), Cmd_Vote_f(), Cmd_Where_f(), CommanderBotCTFAI(), CommanderBotSiegeAI(), CommanderBotTeamplayAI(), CorpsePhysics(), CreateLaserTrap(), CreateMissile(), CreateShield(), CTFFlagMovement(), CTFTakesPriority(), DeadSaberThink(), DeathFX(), DeathmatchScoreboardMessage(), Debug_NPCPrintf(), decompTriggerUse(), DEMP2_AltDetonate(), DEMP2_AltRadiusDamage(), DetPackBlow(), DetPackDie(), DetPackPain(), Disappear(), DismembermentByNum(), DismembermentTest(), Do_Strike(), DoGripAction(), DoImpact(), DoorBlockingSection(), DownedSaberThink(), drop_charge(), Drop_Item(), Eject(), EjectAll(), emplaced_gun_die(), emplaced_gun_pain(), emplaced_gun_realuse(), emplaced_gun_update(), emplaced_gun_use(), EnergyAmmoStationSettings(), EnergyHealthStationSettings(), EnergyShieldStationSettings(), EntIsGlass(), EWeb_Create(), EWeb_SetBoneAngles(), EWeb_SetBoneAnim(), EWebDie(), EWebDisattach(), EWebFire(), EWebPain(), EWebPositionUser(), EWebThink(), EWebUpdateBoneAngles(), ExplodeDeath(), faller_think(), faller_touch(), FighterIsInSpace(), FighterSuspended(), FindGenericEnemyIndex(), FindIntermissionPoint(), finish_spawning_turretG2(), FinishSpawningItem(), FireVehicleWeapon(), FireWeapon(), FlagObjects(), FlyingCreature(), ForceAbsorb(), ForceDrain(), ForceDrainDamage(), ForceGrip(), ForceHeal(), ForceJump(), ForceJumpCharge(), ForceLightning(), ForceLightningDamage(), ForcePowerUsableOn(), ForceProtect(), ForceRage(), ForceSeeing(), ForceShootDrain(), ForceShootLightning(), ForceSpeed(), ForceTeamForceReplenish(), ForceTeamHeal(), ForceTelepathy(), ForceTelepathyCheckDirectNPCTarget(), ForceThrow(), func_rotating_use(), func_static_use(), func_timer_think(), func_timer_use(), func_usable_die(), func_usable_pain(), func_usable_think(), func_usable_use(), func_wait_return_solid(), funcBBrushDie(), funcBBrushDieGo(), funcBBrushPain(), funcBBrushTouch(), funcBBrushUse(), fx_runner_link(), fx_runner_think(), fx_runner_use(), G2Tur_SetBoneAngles(), G_ActivateBehavior(), G_AddEvent(), G_AddPowerDuelLoserScore(), G_AddPowerDuelScore(), G_AddPredictableEvent(), G_AddPushVecToUcmd(), G_AddVoiceEvent(), G_AimSet(), G_AlertTeam(), G_AngerAlert(), G_ApplyKnockback(), G_ATSTCheckPain(), G_AttachToVehicle(), G_AttackDelay(), G_BounceItem(), G_BounceMissile(), G_BounceObject(), G_BreakArm(), G_CallSpawn(), G_CanBeEnemy(), G_CanDisruptify(), G_CanJumpToEnemyVeh(), G_CanResetDuelists(), G_CanUseDispOn(), G_CheapWeaponFire(), G_CheckAlertEvents(), G_CheckClientIdle(), G_CheckClientTimeouts(), G_CheckForDanger(), G_CheckForDismemberment(), G_CheckInSolid(), G_CheckMovingLoopingSounds(), G_CheckVictoryScript(), G_Chunks(), G_CleanAllFakeClients(), G_ClearEnemy(), G_ClearLineOfSight(), G_ClearLOS(), G_ClearLOS2(), G_ClearLOS3(), G_ClearLOS4(), G_ClearLOS5(), G_Damage(), G_DeathAlert(), G_DeflectMissile(), G_Dismember(), G_DrivableATSTDie(), G_DriveATST(), G_DroidSounds(), G_EjectDroidUnit(), G_EntIsBreakable(), G_EntIsDoor(), G_EntIsRemovableUsable(), G_EntIsUnlockedDoor(), G_EntitiesFree(), G_EntitySound(), G_ExplodeMissile(), G_Find(), G_FindDoorTrigger(), G_FindLocalInterestPoint(), G_FindTeams(), G_ForceSaberOn(), G_FreeEntity(), G_GetBoltPosition(), G_GetDismemberBolt(), G_GetDismemberLoc(), G_GetDuelWinner(), G_GetHitLocation(), G_GetHitLocFromSurfName(), G_GetHitQuad(), G_GetJediMaster(), G_HeavyMelee(), G_HeldByMonster(), G_InitGame(), G_InitGentity(), G_IsRidingVehicle(), G_KillBox(), G_Knockdown(), G_KnockOffVehicle(), G_LetGoOfWall(), G_LocationBasedDamageModifier(), G_MiscModelExplosion(), G_MissileBounceEffect(), G_MissileImpact(), G_MoverPush(), G_MoverTeam(), G_MoverTouchPushTriggers(), G_MuteSound(), G_OtherPlayersDueling(), G_PickDeathAnim(), G_PickTarget(), G_PlayDoorLoopSound(), G_PlayDoorSound(), G_PlayEffect(), G_PlayEffectID(), G_PlayerHasCustomSkeleton(), G_PortalifyEntities(), G_PowerDuelCheckFail(), G_PrecacheSoundsets(), G_PreDefSound(), G_RadiusDamage(), G_RadiusList(), G_ReflectMissile(), G_RemoveDuelist(), G_ResetDuelists(), G_RMGPathing(), G_ROFF_NotetrackCallback(), G_RunClient(), G_RunExPhys(), G_RunFrame(), G_RunItem(), G_RunMissile(), G_RunMover(), G_RunObject(), G_RunStuckMissile(), G_RunThink(), G_SaberModelSetup(), G_Say(), G_ScaleNetHealth(), G_ScreenShake(), G_SetActiveState(), G_SetAngles(), G_SetAnim(), G_SetClientSound(), G_SetEnemy(), G_SetOrigin(), G_SetSaber(), G_SetTauntAnim(), G_ShutdownGame(), G_SiegeClientExData(), G_Sound(), G_SoundAtLoc(), G_SoundOnEnt(), G_SoundTempEntity(), G_Spawn(), G_SpawnEntitiesFromString(), G_SpawnGEntityFromSpawnVars(), G_SpawnItem(), G_SpecialRollGetup(), G_SpecialSpawnItem(), G_SpeechEvent(), G_SPSaberDamageTraceLerped(), G_StartFlee(), G_StartMatrixEffect(), G_StartObjectMoving(), G_StopObjectMoving(), G_TeamEnemy(), G_TempEntity(), G_TestEntityPosition(), G_TestLine(), G_ThereIsAMaster(), G_Throw(), G_TouchTriggers(), G_TryPushingEntity(), G_UcmdMoveForDir(), G_UpdateClientAnims(), G_UpdateClientBroadcasts(), G_UseDispenserOn(), G_UseTargets(), G_UseTargets2(), G_ValidateSiegeClassForTeam(), G_VehicleAttachDroidUnit(), G_VehicleSpawn(), G_VehMuzzleFireFX(), GEntity_UseFunc(), GetClosestSpawn(), GetIdealDestination(), GetNearestBadThing(), GetNewFlagPoint(), GetNextSpawnInIndex(), GetObjectThatTargets(), GibEntity(), GlassDie(), GlassDie_Old(), GlassPain(), GlassUse(), GlobalUse(), GM_Dying(), Grenadier_ClearTimers(), health_power_converter_use(), HolocronPopOut(), HolocronRespawn(), HolocronThink(), HolocronTouch(), HolocronUpdate(), Howler_TryDamage(), hurt_touch(), hurt_use(), hyperspace_touch(), IdealDistance(), ImperialProbe_FireBlaster(), ImperialProbe_MaintainHeight(), InFOV(), InFOV2(), InitBodyQue(), Initialize(), InitMover(), InitMoverTrData(), InitShooter(), InitTrigger(), Interrogator_die(), Interrogator_MaintainHeight(), InVisrange(), ItemUse_Binoculars(), ItemUse_Jetpack(), ItemUse_MedPack(), ItemUse_MedPack_Big(), ItemUse_Seeker(), ItemUse_Sentry(), ItemUse_Shield(), ItemUse_UseCloak(), ItemUse_UseDisp(), ItemUse_UseEWeb(), Jedi_Ambush(), Jedi_CanPullBackSaber(), Jedi_CheckAmbushPlayer(), Jedi_CheckFlipEvasions(), Jedi_ClearTimers(), Jedi_Cloak(), Jedi_Decloak(), Jedi_DodgeEvasion(), Jedi_FindEnemyInCone(), Jedi_PlayBlockedPushSound(), Jedi_PlayDeflectSound(), Jedi_QuickReactions(), Jedi_RageStop(), Jedi_ReCalcParryTime(), Jedi_SaberBlockGo(), Jedi_SaberBusy(), Jedi_WaitingAmbush(), JediMasterUpdate(), Jetpack_Off(), Jetpack_On(), JMSaberThink(), JMSaberTouch(), JMTakesPriority(), laserTrapDelayedExplode(), laserTrapExplode(), laserTrapStick(), laserTrapThink(), LaunchItem(), LimbThink(), LimbTouch(), LoadPath_ThisLevel(), locateCamera(), LockDoors(), LogAccuracyHit(), LookAtKiller(), maglock_die(), maglock_link(), MaintainBodyQueue(), MakeDeadSaber(), Mark1_die(), Mark1_dying(), Mark1_FireBlaster(), Mark1_FireRocket(), Mark1Dead_FireBlaster(), Mark1Dead_FireRocket(), Mark2_FireBlaster(), MatchTeam(), MineMonster_TryDamage(), misc_dlight_use(), misc_faller_create(), misc_faller_think(), misc_weapon_shooter_aim(), misc_weapon_shooter_fire(), misc_weapon_shooter_use(), moveAndRotateCallback(), MoveClientToIntermission(), MoveOwner(), moverCallback(), multi_trigger(), multi_trigger_run(), multi_wait(), NAV_AvoidCollision(), NAV_Bypass(), NAV_CheckAhead(), NAV_CheckNodeFailedForEnt(), NAV_ClearBlockedInfo(), NAV_ClearPathToPoint(), NAV_FindClosestWaypointForEnt(), NAV_FindClosestWaypointForPoint(), NAV_FindClosestWaypointForPoint2(), NAV_GetNearestNode(), NAV_MoveBlocker(), NAV_MoveToGoal(), NAV_ResolveBlock(), NAV_ResolveEntityCollision(), NAV_SetBlockedInfo(), NAV_StackedCanyon(), NAV_Steer(), NAV_StoreWaypoint(), NAV_TestBestNode(), NAV_TestForBlocked(), NAV_TrueCollision(), NAV_WaypointsTooFar(), NAVNEW_AvoidCollision(), NAVNEW_Bypass(), NAVNEW_CheckDoubleBlock(), NAVNEW_DanceWithBlocker(), NAVNEW_MoveToGoal(), NAVNEW_PushBlocker(), NAVNEW_ResolveEntityCollision(), NAVNEW_SidestepBlocker(), NAVNEW_TestNodeConnectionBlocked(), NPC_Accelerate(), NPC_ATST_Pain(), NPC_Begin(), NPC_Blocked(), NPC_BSAdvanceFight(), NPC_BSEmplaced(), NPC_BSFlee(), NPC_BSGM_Attack(), NPC_BSGrenadier_Attack(), NPC_BSJedi_Default(), NPC_BSJedi_FollowLeader(), NPC_BSMove(), NPC_BSRancor_Default(), NPC_BSSeeker_Default(), NPC_BSST_Attack(), NPC_BSStandGuard(), NPC_BSWampa_Default(), NPC_CheckCanAttack(), NPC_CheckEnemy(), NPC_CheckEnemyStealth(), NPC_CheckGetNewWeapon(), NPC_CheckInvestigate(), NPC_CheckLookTarget(), NPC_CheckPlayerTeamStealth(), NPC_CheckPossibleEnemy(), NPC_CheckVisibility(), NPC_ChoosePainAnimation(), NPC_ClearBlocked(), NPC_ClearGoal(), NPC_ClearLookTarget(), NPC_ClearLOS2(), NPC_ClearLOS3(), NPC_ClearLOS4(), NPC_ClearPathToGoal(), NPC_ClearShot(), NPC_DefaultScriptFlags(), NPC_Droid_Pain(), NPC_EnemyTooFar(), NPC_EntRangeFromBolt(), NPC_ExecuteBState(), NPC_FaceEntity(), NPC_FindEnemy(), NPC_FindNearestEnemy(), NPC_GalakMech_Init(), NPC_GetPainChance(), NPC_GM_Pain(), NPC_Grenadier_Pain(), NPC_Grenadier_PlayConfusionSound(), NPC_Howler_Pain(), NPC_Interrogator_Precache(), NPC_Jedi_Pain(), NPC_Jedi_PlayConfusionSound(), NPC_Jedi_RateNewEnemy(), NPC_Kill_f(), NPC_Mark1_Pain(), NPC_Mark1_Part_Explode(), NPC_Mark2_Pain(), NPC_Mark2_Part_Explode(), NPC_MineMonster_Pain(), NPC_Pain(), NPC_PainFunc(), NPC_ParseParms(), NPC_PickAlly(), NPC_PickEnemy(), NPC_PickEnemyExt(), NPC_PlayConfusionSound(), NPC_Precache(), NPC_PrecacheType(), NPC_PrintScore(), NPC_Probe_Pain(), NPC_Rancor_Pain(), NPC_Remote_Pain(), NPC_RemoveBody(), NPC_Respond(), NPC_SearchForWeapons(), NPC_Seeker_Pain(), NPC_Sentry_Pain(), NPC_SetAnim(), NPC_SetBlocked(), NPC_SetBoneAngles(), NPC_SetFX_SpawnStates(), NPC_SetGoal(), NPC_SetLookTarget(), NPC_SetMiscDefaultData(), NPC_SetMoveGoal(), NPC_SetPainEvent(), NPC_SetPickUpGoal(), NPC_SetSurfaceOnOff(), NPC_SetWeapons(), NPC_ShotEntity(), NPC_ShowDebugInfo(), NPC_ShySpawn(), NPC_Sniper_Pain(), NPC_Sniper_PlayConfusionSound(), NPC_SomeoneLookingAtMe(), NPC_Spawn(), NPC_Spawn_Do(), NPC_Spawn_f(), NPC_Spawn_Go(), NPC_SpawnEffect(), NPC_SpawnType(), NPC_SpotWouldTelefrag(), NPC_ST_Pain(), NPC_StandTrackAndShoot(), NPC_StartFlee(), NPC_TargetVisible(), NPC_TempLookTarget(), NPC_Think(), NPC_Touch(), NPC_TouchFunc(), NPC_Use(), NPC_UseResponse(), NPC_ValidEnemy(), NPC_VehiclePrecache(), NPC_VehicleSpawnUse(), NPC_Wampa_Pain(), ObjectDie(), OnSameTeam(), P_DamageFeedback(), P_WorldEffects(), pas_adjust_enemy(), pas_fire(), pas_think(), PassLovedOneCheck(), PassStandardEnemyChecks(), Pickup_Ammo(), Pickup_Armor(), Pickup_Health(), Pickup_Holdable(), Pickup_Powerup(), Pickup_Team(), Pickup_Weapon(), pitch_roll_for_slope(), PlaceShield(), player_die(), PlayersInGame(), PM_HoverTrace(), PM_VehicleImpact(), PmoveSingle(), PrintCTFMessage(), ProcessOrientCommands(), prox_mine_think(), proxMineThink(), Q3_GetFloat(), Q3_GetString(), Q3_GetTag(), Q3_GetVector(), Q3_Kill(), Q3_Lerp2Angles(), Q3_Lerp2End(), Q3_Lerp2Origin(), Q3_Lerp2Pos(), Q3_Lerp2Start(), Q3_Play(), Q3_PlaySound(), Q3_Remove(), Q3_RemoveEnt(), Q3_Set(), Q3_SetICARUSFreeze(), Q3_SetLoopSound(), Q3_SetParm(), Q3_Use(), Rancor_Bite(), Rancor_CheckRoar(), Rancor_Crush(), Rancor_DropVictim(), Rancor_SetBolts(), Rancor_Smash(), Rancor_Swing(), Reached_BinaryMover(), Reached_Train(), ReachedGoal(), ref_link(), Remote_Fire(), Remote_MaintainHeight(), respawn(), RespawnItem(), ReturnToPos1(), RocketDie(), rocketThink(), saberBackToOwner(), SaberBounceSound(), saberCheckKnockdown_BrokenParry(), saberCheckKnockdown_DuelLoss(), saberCheckKnockdown_Smashed(), saberCheckKnockdown_Thrown(), saberFirstThrown(), SaberGotHit(), saberKnockDown(), saberKnockOutOfHand(), saberReactivate(), SaberUpdateSelf(), ScorePlum(), scriptrunner_run(), Seeker_FindEnemy(), Seeker_Fire(), Seeker_FollowOwner(), Seeker_MaintainHeight(), SeekerDroneUpdate(), SelectCTFSpawnPoint(), SelectDuelSpawnPoint(), SelectInitialSpawnPoint(), SelectNearestDeathmatchSpawnPoint(), SelectRandomDeathmatchSpawnPoint(), SelectRandomFurthestSpawnPoint(), SelectRandomTeamSpawnPoint(), SelectSiegeSpawnPoint(), SelectSpawnPoint(), SelectSpectatorSpawnPoint(), SendPendingPredictableEvents(), Sentry_Fire(), Sentry_MaintainHeight(), sentry_use(), sentryExpire(), SentryTouch(), SetClientViewAngle(), SetGoal(), SetMoverState(), SetNPCGlobals(), SetTeam(), SetTeamNumbers(), SetTeamQuick(), SetupGameGhoul2Model(), shield_power_converter_use(), ShieldDie(), ShieldGoNotSolid(), ShieldGoSolid(), ShieldPain(), ShieldRemove(), ShieldThink(), ShieldTouch(), shipboundary_think(), shipboundary_touch(), ShotThroughGlass(), Siege_CountDefenders(), Siege_CountTeammates(), Siege_DefendFromAttackers(), Siege_TargetClosestObjective(), SiegeBeginRound(), SiegeBroadcast_OBJECTIVECOMPLETE(), SiegeBroadcast_ROUNDOVER(), SiegeCheckTimers(), SiegeDoTeamAssign(), siegeEndUse(), SiegeIconUse(), SiegeItemDie(), SiegeItemPain(), SiegeItemRemoveOwner(), SiegeItemThink(), SiegeItemTouch(), SiegeItemUse(), SiegePointUse(), SiegeRespawn(), SiegeRoundComplete(), siegeTriggerUse(), Sniper_ClearTimers(), Sniper_EvaluateShot(), SolidifyOwner(), SP_CreateRain(), SP_CreateSnow(), SP_CreateSpaceDust(), SP_emplaced_gun(), SP_func_bobbing(), SP_func_breakable(), SP_func_button(), SP_func_door(), SP_func_glass(), SP_func_pendulum(), SP_func_plat(), SP_func_rotating(), SP_func_static(), SP_func_timer(), SP_func_train(), SP_func_usable(), SP_func_wall(), SP_fx_runner(), SP_gametype_item(), SP_info_camp(), SP_info_jedimaster_start(), SP_info_notnull(), SP_info_null(), SP_info_player_deathmatch(), SP_info_player_duel(), SP_info_player_duel1(), SP_info_player_duel2(), SP_info_player_intermission(), SP_info_player_intermission_blue(), SP_info_player_intermission_red(), SP_info_player_siegeteam1(), SP_info_player_siegeteam2(), SP_info_player_start(), SP_info_player_start_blue(), SP_info_player_start_red(), SP_info_siege_decomplete(), SP_info_siege_objective(), SP_info_siege_radaricon(), SP_item_botroam(), SP_light(), SP_misc_ammo_floor_unit(), SP_misc_bsp(), SP_misc_faller(), SP_misc_G2model(), SP_misc_holocron(), SP_misc_maglock(), SP_misc_model(), SP_misc_model_ammo_power_converter(), SP_misc_model_health_power_converter(), SP_misc_model_shield_power_converter(), SP_misc_model_static(), SP_misc_portal_camera(), SP_misc_portal_surface(), SP_misc_shield_floor_unit(), SP_misc_siege_item(), SP_misc_skyportal(), SP_misc_skyportal_orient(), SP_misc_teleporter_dest(), SP_misc_turret(), SP_misc_turretG2(), SP_misc_weapon_shooter(), SP_misc_weather_zone(), SP_NPC_Alora(), SP_NPC_Bartender(), SP_NPC_BespinCop(), SP_NPC_Cultist(), SP_NPC_Cultist_Commando(), SP_NPC_Cultist_Destroyer(), SP_NPC_Cultist_Saber(), SP_NPC_Cultist_Saber_Powers(), SP_NPC_Desann(), SP_NPC_Droid_ATST(), SP_NPC_Droid_Gonk(), SP_NPC_Droid_Interrogator(), SP_NPC_Droid_Mark1(), SP_NPC_Droid_Mark2(), SP_NPC_Droid_Mouse(), SP_NPC_Droid_Probe(), SP_NPC_Droid_Protocol(), SP_NPC_Droid_R2D2(), SP_NPC_Droid_R5D2(), SP_NPC_Droid_Remote(), SP_NPC_Droid_Seeker(), SP_NPC_Droid_Sentry(), SP_NPC_Galak(), SP_NPC_Gran(), SP_NPC_Imperial(), SP_NPC_ImpWorker(), SP_NPC_Jan(), SP_NPC_Jawa(), SP_NPC_Jedi(), SP_NPC_Kyle(), SP_NPC_Lando(), SP_NPC_Luke(), SP_NPC_MineMonster(), SP_NPC_MonMothma(), SP_NPC_Monster_Claw(), SP_NPC_Monster_Fish(), SP_NPC_Monster_Flier2(), SP_NPC_Monster_Glider(), SP_NPC_Monster_Howler(), SP_NPC_Monster_Lizard(), SP_NPC_Monster_Murjj(), SP_NPC_Monster_Rancor(), SP_NPC_Monster_Swamp(), SP_NPC_Monster_Wampa(), SP_NPC_MorganKatarn(), SP_NPC_Noghri(), SP_NPC_Prisoner(), SP_NPC_Rebel(), SP_NPC_Reborn(), SP_NPC_Reborn_New(), SP_NPC_Reelo(), SP_NPC_Rodian(), SP_NPC_ShadowTrooper(), SP_NPC_Snowtrooper(), SP_NPC_spawner(), SP_NPC_Stormtrooper(), SP_NPC_StormtrooperOfficer(), SP_NPC_SwampTrooper(), SP_NPC_Tavion(), SP_NPC_Tavion_New(), SP_NPC_Tie_Pilot(), SP_NPC_Trandoshan(), SP_NPC_Tusken(), SP_NPC_Ugnaught(), SP_NPC_Vehicle(), SP_NPC_Weequay(), SP_PAS(), SP_path_corner(), SP_point_combat(), SP_reference_tag(), SP_shooter_blaster(), SP_target_activate(), SP_target_counter(), SP_target_deactivate(), SP_target_delay(), SP_target_escapetrig(), SP_target_give(), SP_target_interest(), SP_target_kill(), SP_target_laser(), SP_target_level_change(), SP_target_location(), SP_target_play_music(), SP_target_position(), SP_target_print(), SP_target_push(), SP_target_random(), SP_target_relay(), SP_target_remove_powerups(), SP_target_score(), SP_target_screenshake(), SP_target_scriptrunner(), SP_target_siege_end(), SP_target_speaker(), SP_target_teleporter(), SP_team_CTF_blueplayer(), SP_team_CTF_bluespawn(), SP_team_CTF_redplayer(), SP_team_CTF_redspawn(), SP_terrain(), SP_trigger_always(), SP_trigger_asteroid_field(), SP_trigger_hurt(), SP_trigger_hyperspace(), SP_trigger_lightningstrike(), SP_trigger_multiple(), SP_trigger_once(), SP_trigger_push(), SP_trigger_shipboundary(), SP_trigger_space(), SP_trigger_teleport(), SP_waypoint(), SP_waypoint_navgoal(), SP_waypoint_navgoal_1(), SP_waypoint_navgoal_2(), SP_waypoint_navgoal_4(), SP_waypoint_navgoal_8(), SP_waypoint_small(), space_touch(), SpawnPlatTrigger(), SpecialItemThink(), SpectatorClientEndFrame(), SpectatorThink(), SpotWouldTelefrag(), SpotWouldTelefrag2(), ST_AggressionAdjust(), ST_ApproachEnemy(), ST_ClearTimers(), ST_Commander(), ST_HuntEnemy(), ST_MarkToCover(), ST_ResolveBlockedShot(), ST_StartFlee(), ST_TrackEnemy(), ST_TransferMoveGoal(), ST_TransferTimers(), StandardBotAI(), StandardSetBodyAnim(), StopFollowing(), Svcmd_EntityList_f(), target_activate_use(), target_counter_use(), target_deactivate_use(), target_kill_use(), target_laser_off(), target_laser_on(), target_laser_start(), target_laser_think(), target_laser_use(), target_level_change_use(), target_play_music_use(), target_random_use(), target_relay_use(), target_scriptrunner_use(), target_teleporter_use(), Team_CaptureFlagSound(), Team_CheckDroppedItem(), Team_CheckHurtCarrier(), Team_DroppedFlagThink(), Team_ForceGesture(), Team_FragBonuses(), Team_FreeEntity(), Team_GetLocation(), Team_GetLocationMsg(), Team_ResetFlag(), Team_ReturnFlagSound(), Team_TakeFlagSound(), Team_TouchEnemyFlag(), Team_TouchOurFlag(), TeamplayInfoMessage(), TeleportPlayer(), TeleportToWP(), thermalDetonatorExplode(), thermalThinkStandard(), Think_BeginMoving(), Think_MatchTeam(), Think_SetupTrainTargets(), Think_SpawnNewDoorTrigger(), Think_Strike(), Think_Target_Delay(), thrownSaberTouch(), ThrowSaberToAttacker(), TIMER_Clear2(), TIMER_Done(), TIMER_Done2(), TIMER_Exists(), TIMER_Get(), TIMER_Remove(), TIMER_Set(), TIMER_Start(), TossClientItems(), TossClientWeapon(), Touch_Button(), Touch_DoorTrigger(), Touch_Item(), Touch_Multi(), touch_NULL(), Touch_Plat(), Touch_PlatCenterTrigger(), touchLaserTrap(), trap_AdjustAreaPortalState(), trap_EntityContact(), trap_EntityContactCapsule(), trap_ICARUS_AssociateEnt(), trap_ICARUS_FreeEnt(), trap_ICARUS_InitEnt(), trap_ICARUS_RunScript(), trap_ICARUS_TaskIDComplete(), trap_ICARUS_TaskIDPending(), trap_ICARUS_TaskIDSet(), trap_ICARUS_ValidEnt(), trap_LinkEntity(), trap_LocateGameData(), trap_Nav_AddFailedNode(), trap_Nav_CheckFailedNodes(), trap_Nav_GetBestPathBetweenEnts(), trap_Nav_GetNearestNode(), trap_Nav_NodeFailed(), trap_SetBrushModel(), trap_UnlinkEntity(), TrapThink(), trigger_always_think(), trigger_cleared_fire(), trigger_push_touch(), trigger_teleporter_touch(), TryGrapple(), TryHeal(), TryUse(), TurboLaser_SetBoneAnim(), turret_base_spawn_top(), turret_base_think(), turret_base_use(), turret_die(), turret_head_think(), TurretBasePain(), turretG2_base_think(), turretG2_base_use(), turretG2_die(), turretG2_head_think(), turretG2_respawn(), turretG2_set_models(), TurretG2Pain(), TurretPain(), UnLockDoors(), Update(), UpdateClientRenderBolts(), UpdateClientRenderinfo(), UpdateGoal(), UpdateTournamentInfo(), Use_BinaryMover(), Use_BinaryMover_Go(), Use_Item(), Use_Multi(), Use_Shooter(), Use_Strike(), Use_Target_Delay(), Use_Target_Escapetrig(), Use_Target_Give(), Use_Target_Print(), Use_target_push(), Use_target_remove_powerups(), Use_Target_Score(), Use_Target_Screenshake(), Use_Target_Speaker(), use_wall(), UseSiegeTarget(), ValidateBoard(), ValidEnemy(), ValidUseTarget(), VEH_TryEject(), VEH_TurretAim(), VEH_TurretAnglesToEnemy(), VEH_TurretCheckFire(), VEH_TurretObeyPassengerControl(), VEH_TurretThink(), Vehicle_SetAnim(), W_TraceSetStart(), Wampa_CheckRoar(), Wampa_SetBolts(), Wampa_Slash(), waypoint_getRadius(), WP_AbsorbConversion(), WP_ActivateSaber(), WP_AddToClientBitflags(), WP_CalcVehMuzzle(), WP_DeactivateSaber(), WP_DisruptorAltFire(), WP_DoSpecificPower(), WP_DropDetPack(), WP_DropThermal(), WP_ExplosiveDie(), WP_FireBlasterMissile(), WP_FireEmplacedMissile(), WP_FireGenericBlasterMissile(), WP_FireMelee(), WP_FireStunBaton(), WP_FireThermalDetonator(), WP_FireTurboLaserMissile(), WP_FireTurretMissile(), WP_FireVehicleWeapon(), WP_flechette_alt_blow(), WP_ForcePowerAvailable(), WP_ForcePowerInUse(), WP_ForcePowerRegenerate(), WP_ForcePowerStart(), WP_ForcePowerStop(), WP_ForcePowersUpdate(), WP_ForcePowerUsable(), WP_GetVehicleCamPos(), WP_GetVelocityForForceJump(), WP_InitForcePowers(), WP_LobFire(), WP_PlaceLaserTrap(), WP_ResistForcePush(), WP_SaberAddG2Model(), WP_SaberApplyDamage(), WP_SaberBlock(), WP_SaberBlockNonRandom(), WP_SaberBounceSound(), WP_SaberCanBlock(), WP_SaberDoClash(), WP_SaberDoHit(), WP_SaberInitBladeData(), WP_SaberLength(), WP_SaberPositionUpdate(), WP_SaberRadiusDamage(), WP_SaberRemoveG2Model(), WP_SabersCheckLock(), WP_SabersIntersect(), WP_SaberStartMissileBlockCheck(), WP_SpawnInitForcePowers(), WP_TouchVehMissile(), WP_VehCheckTraceFromCamPos(), WP_VehLeadCrosshairVeh(), WP_VehWeapSetSolidToOwner(), and WPOrgVisible().

typedef struct reference_tag_s reference_tag_t
 

Referenced by FirstFreeRefTag(), ref_link(), TAG_Add(), TAG_Find(), TAG_GetAngles(), TAG_GetFlags(), TAG_GetOrigin(), TAG_GetOrigin2(), and TAG_GetRadius().

typedef struct renderInfo_s renderInfo_t
 

Referenced by NPC_ParseParms(), Rancor_SetBolts(), UpdateClientRenderBolts(), UpdateClientRenderinfo(), and Wampa_SetBolts().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
HL_NONE 
HL_FOOT_RT 
HL_FOOT_LT 
HL_LEG_RT 
HL_LEG_LT 
HL_WAIST 
HL_BACK_RT 
HL_BACK_LT 
HL_BACK 
HL_CHEST_RT 
HL_CHEST_LT 
HL_CHEST 
HL_ARM_RT 
HL_ARM_LT 
HL_HAND_RT 
HL_HAND_LT 
HL_HEAD 
HL_GENERIC1 
HL_GENERIC2 
HL_GENERIC3 
HL_GENERIC4 
HL_GENERIC5 
HL_GENERIC6 
HL_MAX 

Definition at line 98 of file g_local.h.

00099 {
00100         HL_NONE = 0,
00101         HL_FOOT_RT,
00102         HL_FOOT_LT,
00103         HL_LEG_RT,
00104         HL_LEG_LT,
00105         HL_WAIST,
00106         HL_BACK_RT,
00107         HL_BACK_LT,
00108         HL_BACK,
00109         HL_CHEST_RT,
00110         HL_CHEST_LT,
00111         HL_CHEST,
00112         HL_ARM_RT,
00113         HL_ARM_LT,
00114         HL_HAND_RT,
00115         HL_HAND_LT,
00116         HL_HEAD,
00117         HL_GENERIC1,
00118         HL_GENERIC2,
00119         HL_GENERIC3,
00120         HL_GENERIC4,
00121         HL_GENERIC5,
00122         HL_GENERIC6,
00123         HL_MAX
00124 };

anonymous enum
 

Enumeration values:
CON_DISCONNECTED 
CON_CONNECTING 
CON_CONNECTED 

Definition at line 366 of file g_local.h.

00366              {
00367         CON_DISCONNECTED,
00368         CON_CONNECTING,
00369         CON_CONNECTED
00370 };

enum alertEventLevel_e
 

Enumeration values:
AEL_MINOR 
AEL_SUSPICIOUS 
AEL_DISCOVERED 
AEL_DANGER 
AEL_DANGER_GREAT 

Definition at line 777 of file g_local.h.

00778 {
00779         AEL_MINOR,                      //Enemy responds to the sound, but only by looking
00780         AEL_SUSPICIOUS,         //Enemy looks at the sound, and will also investigate it
00781         AEL_DISCOVERED,         //Enemy knows the player is around, and will actively hunt
00782         AEL_DANGER,                     //Enemy should try to find cover
00783         AEL_DANGER_GREAT,       //Enemy should run like hell!
00784 } alertEventLevel_e;

enum alertEventType_e
 

Enumeration values:
AET_SIGHT 
AET_SOUND 

Definition at line 771 of file g_local.h.

00772 {
00773         AET_SIGHT,
00774         AET_SOUND,
00775 } alertEventType_e;

enum moverState_t
 

Enumeration values:
MOVER_POS1 
MOVER_POS2 
MOVER_1TO2 
MOVER_2TO1 

Definition at line 89 of file g_local.h.

Referenced by MatchTeam(), Q3_Lerp2Origin(), and Q3_Lerp2Pos().

00089              {
00090         MOVER_POS1,
00091         MOVER_POS2,
00092         MOVER_1TO2,
00093         MOVER_2TO1
00094 } moverState_t;

enum playerTeamStateState_t
 

Enumeration values:
TEAM_BEGIN 
TEAM_ACTIVE 

Definition at line 380 of file g_local.h.

00380              {
00381         TEAM_BEGIN,             // Beginning a team game, spawn at base
00382         TEAM_ACTIVE             // Now actively playing
00383 } playerTeamStateState_t;

enum spectatorState_t
 

Enumeration values:
SPECTATOR_NOT 
SPECTATOR_FREE 
SPECTATOR_FOLLOW 
SPECTATOR_SCOREBOARD 

Definition at line 373 of file g_local.h.

Referenced by G_ReadSessionData(), and SetTeam().


Function Documentation

void Add_Ammo gentity_t ent,
int  weapon,
int  count
 

Definition at line 2118 of file g_items.c.

References playerState_s::ammo, ammoData, gentity_s::client, gentity_t, ammoData_s::max, and gclient_s::ps.

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

02119 {
02120         if ( ent->client->ps.ammo[weapon] < ammoData[weapon].max )
02121         {
02122                 ent->client->ps.ammo[weapon] += count;
02123                 if ( ent->client->ps.ammo[weapon] > ammoData[weapon].max )
02124                 {
02125                         ent->client->ps.ammo[weapon] = ammoData[weapon].max;
02126                 }
02127         }
02128 }

void AddRemap const char *  oldShader,
const char *  newShader,
float  timeOffset
 

Definition at line 20 of file g_utils.c.

References MAX_SHADER_REMAPS, Q_stricmp(), remapCount, remappedShaders, strcpy(), and shaderRemap_t::timeOffset.

Referenced by G_RemapTeamShaders(), and G_UseTargets2().

00020                                                                               {
00021         int i;
00022 
00023         for (i = 0; i < remapCount; i++) {
00024                 if (Q_stricmp(oldShader, remappedShaders[i].oldShader) == 0) {
00025                         // found it, just update this one
00026                         strcpy(remappedShaders[i].newShader,newShader);
00027                         remappedShaders[i].timeOffset = timeOffset;
00028                         return;
00029                 }
00030         }
00031         if (remapCount < MAX_SHADER_REMAPS) {
00032                 strcpy(remappedShaders[remapCount].newShader,newShader);
00033                 strcpy(remappedShaders[remapCount].oldShader,oldShader);
00034                 remappedShaders[remapCount].timeOffset = timeOffset;
00035                 remapCount++;
00036         }
00037 }

void AddScore gentity_t ent,
vec3_t  origin,
int  score
 

Definition at line 436 of file g_combat.c.

References CalculateRanks(), gentity_s::client, g_dontPenalizeTeam, g_gametype, gentity_t, GT_TEAM, vmCvar_t::integer, level, PERS_SCORE, PERS_TEAM, playerState_s::persistant, gclient_s::ps, level_locals_t::teamScores, vec3_t, and level_locals_t::warmupTime.

Referenced by AddSiegeWinningTeamPoints(), BroadcastObjectiveCompletion(), player_die(), Team_FragBonuses(), Team_TouchEnemyFlag(), Team_TouchOurFlag(), Use_Target_Escapetrig(), and Use_Target_Score().

00437 {
00438         /*
00439         if (g_gametype.integer == GT_SIEGE)
00440         { //no scoring in this gametype at all.
00441                 return;
00442         }
00443         */
00444 
00445         if ( !ent->client ) {
00446                 return;
00447         }
00448         // no scoring during pre-match warmup
00449         if ( level.warmupTime ) {
00450                 return;
00451         }
00452         // show score plum
00453         //ScorePlum(ent, origin, score);
00454         //
00455         ent->client->ps.persistant[PERS_SCORE] += score;
00456         if ( g_gametype.integer == GT_TEAM && !g_dontPenalizeTeam )
00457                 level.teamScores[ ent->client->ps.persistant[PERS_TEAM] ] += score;
00458         CalculateRanks();
00459 }

void AddSightEvent gentity_t owner,
vec3_t  position,
float  radius,
alertEventLevel_e  alertLevel,
float  addLight
 

Definition at line 623 of file NPC_senses.c.

References AEL_DANGER, AET_SIGHT, level_locals_t::alertEvents, level_locals_t::curAlertID, gentity_t, level, MAX_ALERT_EVENTS, NULL, level_locals_t::numAlertEvents, RemoveOldestAlert(), level_locals_t::time, vec3_t, and VectorCopy.

Referenced by CorpsePhysics(), ForceTelepathyCheckDirectNPCTarget(), and NPC_BSRancor_Default().

00624 {
00625         //FIXME: Handle this in another manner?
00626         if ( level.numAlertEvents >= MAX_ALERT_EVENTS )
00627         {
00628                 if ( !RemoveOldestAlert() )
00629                 {//how could that fail?
00630                         return;
00631                 }
00632         }
00633 
00634         if ( owner == NULL && alertLevel < AEL_DANGER ) //allows un-owned danger alerts
00635                 return;
00636 
00637         //FIXME: if owner is not a player or player ally, and there are no player allies present,
00638         //                      perhaps we don't need to store the alert... unless we want the player to
00639         //                      react to enemy alert events in some way?
00640 
00641         VectorCopy( position, level.alertEvents[ level.numAlertEvents ].position );
00642 
00643         level.alertEvents[ level.numAlertEvents ].radius        = radius;
00644         level.alertEvents[ level.numAlertEvents ].level         = alertLevel;
00645         level.alertEvents[ level.numAlertEvents ].type          = AET_SIGHT;
00646         level.alertEvents[ level.numAlertEvents ].owner         = owner;                
00647         level.alertEvents[ level.numAlertEvents ].addLight      = addLight;     //will get added to actual light at that point when it's checked
00648         level.alertEvents[ level.numAlertEvents ].ID            = level.curAlertID++;
00649         level.alertEvents[ level.numAlertEvents ].timestamp     = level.time;
00650 
00651         level.numAlertEvents++;
00652 }

void AddSoundEvent gentity_t owner,
vec3_t  position,
float  radius,
alertEventLevel_e  alertLevel,
qboolean  needLOS
 

Definition at line 579 of file NPC_senses.c.

References AEL_DANGER, AET_SOUND, level_locals_t::alertEvents, level_locals_t::curAlertID, gentity_t, level, MAX_ALERT_EVENTS, NULL, level_locals_t::numAlertEvents, RemoveOldestAlert(), level_locals_t::time, vec3_t, and VectorCopy.

Referenced by ForceTelepathyCheckDirectNPCTarget(), NPC_BSRancor_Default(), and Rancor_Smash().

00580 {
00581         //FIXME: Handle this in another manner?
00582         if ( level.numAlertEvents >= MAX_ALERT_EVENTS )
00583         {
00584                 if ( !RemoveOldestAlert() )
00585                 {//how could that fail?
00586                         return;
00587                 }
00588         }
00589         
00590         if ( owner == NULL && alertLevel < AEL_DANGER ) //allows un-owned danger alerts
00591                 return;
00592 
00593         //FIXME: if owner is not a player or player ally, and there are no player allies present,
00594         //                      perhaps we don't need to store the alert... unless we want the player to
00595         //                      react to enemy alert events in some way?
00596 
00597         VectorCopy( position, level.alertEvents[ level.numAlertEvents ].position );
00598 
00599         level.alertEvents[ level.numAlertEvents ].radius        = radius;
00600         level.alertEvents[ level.numAlertEvents ].level         = alertLevel;
00601         level.alertEvents[ level.numAlertEvents ].type          = AET_SOUND;
00602         level.alertEvents[ level.numAlertEvents ].owner         = owner;
00603         if ( needLOS )
00604         {//a very low-level sound, when check this sound event, check for LOS
00605                 level.alertEvents[ level.numAlertEvents ].addLight      = 1;    //will force an LOS trace on this sound
00606         }
00607         else
00608         {
00609                 level.alertEvents[ level.numAlertEvents ].addLight      = 0;    //will force an LOS trace on this sound
00610         }
00611         level.alertEvents[ level.numAlertEvents ].ID            = level.curAlertID++;
00612         level.alertEvents[ level.numAlertEvents ].timestamp     = level.time;
00613 
00614         level.numAlertEvents++;
00615 }

int ArmorIndex gentity_t ent  ) 
 

void B_CleanupAlloc void   ) 
 

Definition at line 142 of file ai_util.c.

References NULL.

Referenced by G_ShutdownGame().

00143 {
00144 #ifdef BOT_ZMALLOC
00145         int i = 0;
00146 
00147         while (i < MAX_BALLOC)
00148         {
00149                 if (BAllocList[i])
00150                 {
00151                         trap_BotFreeMemoryGame(BAllocList[i]);
00152                         BAllocList[i] = NULL;
00153                 }
00154 
00155                 i++;
00156         }
00157 #endif
00158 }

void B_InitAlloc void   ) 
 

Definition at line 133 of file ai_util.c.

References gWPArray, and memset().

Referenced by G_InitGame().

00134 {
00135 #ifdef BOT_ZMALLOC
00136         memset(BAllocList, 0, sizeof(BAllocList));
00137 #endif
00138 
00139         memset(gWPArray, 0, sizeof(gWPArray));
00140 }

void BeginIntermission void   ) 
 

Definition at line 2019 of file g_main.c.

References AdjustTournamentScores(), client, CS_CLIENT_DUELWINNER, DuelLimitHit(), FindIntermissionPoint(), g_entities, g_gametype, gDuelExit, gentity_t, GT_DUEL, GT_POWERDUEL, vmCvar_t::integer, level_locals_t::intermissiontime, level, level_locals_t::maxclients, MoveClientToIntermission(), qfalse, qtrue, respawn(), SendScoreboardMessageToAllClients(), gclient_s::sess, clientSession_t::sessionTeam, TEAM_SPECTATOR, level_locals_t::time, and trap_SetConfigstring().

Referenced by CheckExitRules(), and Cmd_LevelShot_f().

02019                                {
02020         int                     i;
02021         gentity_t       *client;
02022 
02023         if ( level.intermissiontime ) {
02024                 return;         // already active
02025         }
02026 
02027         // if in tournement mode, change the wins / losses
02028         if ( g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL ) {
02029                 trap_SetConfigstring ( CS_CLIENT_DUELWINNER, "-1" );
02030 
02031                 if (g_gametype.integer != GT_POWERDUEL)
02032                 {
02033                         AdjustTournamentScores();
02034                 }
02035                 if (DuelLimitHit())
02036                 {
02037                         gDuelExit = qtrue;
02038                 }
02039                 else
02040                 {
02041                         gDuelExit = qfalse;
02042                 }
02043         }
02044 
02045         level.intermissiontime = level.time;
02046         FindIntermissionPoint();
02047 
02048         /*
02049         if (g_singlePlayer.integer) {
02050                 trap_Cvar_Set("ui_singlePlayerActive", "0");
02051                 UpdateTournamentInfo();
02052         }
02053         */
02054         //what the? Well, I don't want this to happen.
02055 
02056         // move all clients to the intermission point
02057         for (i=0 ; i< level.maxclients ; i++) {
02058                 client = g_entities + i;
02059                 if (!client->inuse)
02060                         continue;
02061                 // respawn if dead
02062                 if (client->health <= 0) {
02063                         if (g_gametype.integer != GT_POWERDUEL ||
02064                                 !client->client ||
02065                                 client->client->sess.sessionTeam != TEAM_SPECTATOR)
02066                         { //don't respawn spectators in powerduel or it will mess the line order all up
02067                                 respawn(client);
02068                         }
02069                 }
02070                 MoveClientToIntermission( client );
02071         }
02072 
02073         // send the current scoring to all clients
02074         SendScoreboardMessageToAllClients();
02075 
02076 }

void BlowDetpacks gentity_t ent  ) 
 

Definition at line 2849 of file g_weapon.c.

References CHAN_BODY, gentity_s::client, entityShared_t::currentOrigin, DetPackBlow(), FOFS, G_Find(), G_Sound(), G_SoundIndex(), gentity_t, playerState_s::hasDetPackPlanted, level, gentity_s::nextthink, NULL, entityState_s::origin, gentity_s::parent, gclient_s::ps, qfalse, gentity_s::r, random, gentity_s::s, gentity_s::think, level_locals_t::time, and VectorCopy.

Referenced by player_die(), and WP_DropDetPack().

02850 {
02851         gentity_t *found = NULL;
02852 
02853         if ( ent->client->ps.hasDetPackPlanted )
02854         {
02855                 while ( (found = G_Find( found, FOFS(classname), "detpack") ) != NULL )
02856                 {//loop through all ents and blow the crap out of them!
02857                         if ( found->parent == ent )
02858                         {
02859                                 VectorCopy( found->r.currentOrigin, found->s.origin );
02860                                 found->think = DetPackBlow;
02861                                 found->nextthink = level.time + 100 + random() * 200;
02862                                 G_Sound( found, CHAN_BODY, G_SoundIndex("sound/weapons/detpack/warning.wav") );
02863                         }
02864                 }
02865                 ent->client->ps.hasDetPackPlanted = qfalse;
02866         }
02867 }

void body_die gentity_t self,
gentity_t inflictor,
gentity_t attacker,
int  damage,
int  meansOfDeath
 

Definition at line 685 of file g_combat.c.

References BodyRid(), gentity_s::client, entityShared_t::currentOrigin, EF_DISINTEGRATION, entityState_s::eFlags, playerState_s::eFlags, ET_NPC, entityState_s::eType, G_FreeEntity(), gentity_t, GIB_HEALTH, gentity_s::health, playerState_s::lastHitLoc, level, MOD_CRUSH, MOD_FALLING, MOD_LAVA, MOD_SLIME, MOD_SUICIDE, MOD_TARGET_LASER, MOD_TELEFRAG, MOD_TRIGGER_HURT, MOD_UNKNOWN, MOD_WATER, gentity_s::nextthink, playerState_s::origin, entityState_s::origin2, gclient_s::ps, qboolean, qfalse, qtrue, gentity_s::r, gclient_s::respawnTime, gentity_s::s, gentity_s::think, level_locals_t::time, playerState_s::torsoTimer, and VectorCopy.

Referenced by player_die().

00685                                                                                                           {
00686         // NOTENOTE No gibbing right now, this is star wars.
00687         qboolean doDisint = qfalse;
00688 
00689         if (self->s.eType == ET_NPC)
00690         { //well, just rem it then, so long as it's done with its death anim and it's not a standard weapon.
00691                 if ( self->client && self->client->ps.torsoTimer <= 0 &&
00692                          (meansOfDeath == MOD_UNKNOWN ||
00693                           meansOfDeath == MOD_WATER ||
00694                           meansOfDeath == MOD_SLIME ||
00695                           meansOfDeath == MOD_LAVA ||
00696                           meansOfDeath == MOD_CRUSH ||
00697                           meansOfDeath == MOD_TELEFRAG ||
00698                           meansOfDeath == MOD_FALLING ||
00699                           meansOfDeath == MOD_SUICIDE ||
00700                           meansOfDeath == MOD_TARGET_LASER ||
00701                           meansOfDeath == MOD_TRIGGER_HURT) )
00702                 {
00703                         self->think = G_FreeEntity;
00704                         self->nextthink = level.time;
00705                 }
00706                 return;
00707         }
00708 
00709         if (self->health < (GIB_HEALTH+1))
00710         {
00711                 self->health = GIB_HEALTH+1;
00712 
00713                 if (self->client && (level.time - self->client->respawnTime) < 2000)
00714                 {
00715                         doDisint = qfalse;
00716                 }
00717                 else
00718                 {
00719                         doDisint = qtrue;
00720                 }
00721         }
00722 
00723         if (self->client && (self->client->ps.eFlags & EF_DISINTEGRATION))
00724         {
00725                 return;
00726         }
00727         else if (self->s.eFlags & EF_DISINTEGRATION)
00728         {
00729                 return;
00730         }
00731 
00732         if (doDisint)
00733         {
00734                 if (self->client)
00735                 {
00736                         self->client->ps.eFlags |= EF_DISINTEGRATION;
00737                         VectorCopy(self->client->ps.origin, self->client->ps.lastHitLoc);
00738                 }
00739                 else
00740                 {
00741                         self->s.eFlags |= EF_DISINTEGRATION;
00742                         VectorCopy(self->r.currentOrigin, self->s.origin2);
00743 
00744                         //since it's the corpse entity, tell it to "remove" itself
00745                         self->think = BodyRid;
00746                         self->nextthink = level.time + 1000;
00747                 }
00748                 return;
00749         }
00750 }

int BotAILoadMap int  restart  ) 
 

Definition at line 966 of file ai_main.c.

References BotResetState(), botstates, bot_state_s::inuse, MAX_CLIENTS, qtrue, and bot_state_s::setupcount.

Referenced by G_InitGame().

00966                                 {
00967         int                     i;
00968 
00969         for (i = 0; i < MAX_CLIENTS; i++) {
00970                 if (botstates[i] && botstates[i]->inuse) {
00971                         BotResetState( botstates[i] );
00972                         botstates[i]->setupcount = 4;
00973                 }
00974         }
00975 
00976         return qtrue;
00977 }

int BotAISetup int  restart  ) 
 

Definition at line 7575 of file ai_main.c.

References bot_attachments, bot_camp, bot_forcepowers, bot_forgimmick, bot_getinthecarrr, bot_honorableduelacceptance, bot_pvstype, bot_wp_clearweight, bot_wp_distconnect, bot_wp_edit, bot_wp_info, bot_wp_visconnect, botstates, CVAR_CHEAT, memset(), qfalse, qtrue, trap_BotLibSetup(), trap_Cvar_Register(), and trap_Cvar_Update().

Referenced by G_InitGame().

07575                               {
07576         //rww - new bot cvars..
07577         trap_Cvar_Register(&bot_forcepowers, "bot_forcepowers", "1", CVAR_CHEAT);
07578         trap_Cvar_Register(&bot_forgimmick, "bot_forgimmick", "0", CVAR_CHEAT);
07579         trap_Cvar_Register(&bot_honorableduelacceptance, "bot_honorableduelacceptance", "0", CVAR_CHEAT);
07580         trap_Cvar_Register(&bot_pvstype, "bot_pvstype", "1", CVAR_CHEAT);
07581 #ifndef FINAL_BUILD
07582         trap_Cvar_Register(&bot_getinthecarrr, "bot_getinthecarrr", "0", 0);
07583 #endif
07584 
07585 #ifdef _DEBUG
07586         trap_Cvar_Register(&bot_nogoals, "bot_nogoals", "0", CVAR_CHEAT);
07587         trap_Cvar_Register(&bot_debugmessages, "bot_debugmessages", "0", CVAR_CHEAT);
07588 #endif
07589 
07590         trap_Cvar_Register(&bot_attachments, "bot_attachments", "1", 0);
07591         trap_Cvar_Register(&bot_camp, "bot_camp", "1", 0);
07592 
07593         trap_Cvar_Register(&bot_wp_info, "bot_wp_info", "1", 0);
07594         trap_Cvar_Register(&bot_wp_edit, "bot_wp_edit", "0", CVAR_CHEAT);
07595         trap_Cvar_Register(&bot_wp_clearweight, "bot_wp_clearweight", "1", 0);
07596         trap_Cvar_Register(&bot_wp_distconnect, "bot_wp_distconnect", "1", 0);
07597         trap_Cvar_Register(&bot_wp_visconnect, "bot_wp_visconnect", "1", 0);
07598 
07599         trap_Cvar_Update(&bot_forcepowers);
07600         //end rww
07601 
07602         //if the game is restarted for a tournament
07603         if (restart) {
07604                 return qtrue;
07605         }
07606 
07607         //initialize the bot states
07608         memset( botstates, 0, sizeof(botstates) );
07609 
07610         if (!trap_BotLibSetup())
07611         {
07612                 return qfalse; //wts?!
07613         }
07614 
07615         return qtrue;
07616 }

int BotAISetupClient int  client,
struct bot_settings_s settings,
qboolean  restart
 

Definition at line 819 of file ai_main.c.

References B_Alloc(), bot_settings_t, bot_state_t, BotAI_Print(), BotDoChat(), BotScheduleBotThink(), botstates, BotUtilizePersonality(), bot_state_s::botWeaponWeights, bot_state_s::client, client, bot_state_s::entergame_time, bot_state_s::entitynum, FloatTime, g_gametype, bot_state_s::gs, GT_DUEL, GT_POWERDUEL, vmCvar_t::integer, bot_state_s::inuse, memcpy(), memset(), bot_state_s::ms, numbots, PlayersInGame(), PRT_FATAL, qfalse, qtrue, bot_state_s::settings, bot_state_s::setupcount, trap_BotAllocGoalState(), trap_BotAllocMoveState(), trap_BotAllocWeaponState(), WP_BLASTER, WP_BOWCASTER, WP_BRYAR_PISTOL, WP_DEMP2, WP_DET_PACK, WP_DISRUPTOR, WP_FLECHETTE, WP_MELEE, WP_NONE, WP_REPEATER, WP_ROCKET_LAUNCHER, WP_SABER, WP_STUN_BATON, WP_THERMAL, WP_TRIP_MINE, and bot_state_s::ws.

Referenced by G_BotConnect().

00819                                                                                     {
00820         bot_state_t *bs;
00821 
00822         if (!botstates[client]) botstates[client] = (bot_state_t *) B_Alloc(sizeof(bot_state_t)); //G_Alloc(sizeof(bot_state_t));
00823                                                                                                                                                           //rww - G_Alloc bad! B_Alloc good.
00824 
00825         memset(botstates[client], 0, sizeof(bot_state_t));
00826 
00827         bs = botstates[client];
00828 
00829         if (bs && bs->inuse) {
00830                 BotAI_Print(PRT_FATAL, "BotAISetupClient: client %d already setup\n", client);
00831                 return qfalse;
00832         }
00833 
00834         memcpy(&bs->settings, settings, sizeof(bot_settings_t));
00835 
00836         bs->client = client; //need to know the client number before doing personality stuff
00837 
00838         //initialize weapon weight defaults..
00839         bs->botWeaponWeights[WP_NONE] = 0;
00840         bs->botWeaponWeights[WP_STUN_BATON] = 1;
00841         bs->botWeaponWeights[WP_SABER] = 10;
00842         bs->botWeaponWeights[WP_BRYAR_PISTOL] = 11;
00843         bs->botWeaponWeights[WP_BLASTER] = 12;
00844         bs->botWeaponWeights[WP_DISRUPTOR] = 13;
00845         bs->botWeaponWeights[WP_BOWCASTER] = 14;
00846         bs->botWeaponWeights[WP_REPEATER] = 15;
00847         bs->botWeaponWeights[WP_DEMP2] = 16;
00848         bs->botWeaponWeights[WP_FLECHETTE] = 17;
00849         bs->botWeaponWeights[WP_ROCKET_LAUNCHER] = 18;
00850         bs->botWeaponWeights[WP_THERMAL] = 14;
00851         bs->botWeaponWeights[WP_TRIP_MINE] = 0;
00852         bs->botWeaponWeights[WP_DET_PACK] = 0;
00853         bs->botWeaponWeights[WP_MELEE] = 1;
00854 
00855         BotUtilizePersonality(bs);
00856 
00857         if (g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL)
00858         {
00859                 bs->botWeaponWeights[WP_SABER] = 13;
00860         }
00861 
00862         //allocate a goal state
00863         bs->gs = trap_BotAllocGoalState(client);
00864 
00865         //allocate a weapon state
00866         bs->ws = trap_BotAllocWeaponState();
00867 
00868         bs->inuse = qtrue;
00869         bs->entitynum = client;
00870         bs->setupcount = 4;
00871         bs->entergame_time = FloatTime();
00872         bs->ms = trap_BotAllocMoveState();
00873         numbots++;
00874 
00875         //NOTE: reschedule the bot thinking
00876         BotScheduleBotThink();
00877 
00878         if (PlayersInGame())
00879         { //don't talk to yourself
00880                 BotDoChat(bs, "GeneralGreetings", 0);
00881         }
00882 
00883         return qtrue;
00884 }

int BotAIShutdown int  restart  ) 
 

Definition at line 7623 of file ai_main.c.

References BotAIShutdownClient(), botstates, client, bot_state_s::inuse, MAX_CLIENTS, qtrue, and trap_BotLibShutdown().

Referenced by G_ShutdownGame().

07623                                  {
07624 
07625         int i;
07626 
07627         //if the game is restarted for a tournament
07628         if ( restart ) {
07629                 //shutdown all the bots in the botlib
07630                 for (i = 0; i < MAX_CLIENTS; i++) {
07631                         if (botstates[i] && botstates[i]->inuse) {
07632                                 BotAIShutdownClient(botstates[i]->client, restart);
07633                         }
07634                 }
07635                 //don't shutdown the bot library
07636         }
07637         else {
07638                 trap_BotLibShutdown();
07639         }
07640         return qtrue;
07641 }

int BotAIShutdownClient int  client,
qboolean  restart
 

Definition at line 891 of file ai_main.c.

References bot_state_t, botstates, client, bot_state_s::gs, bot_state_s::inuse, memset(), bot_state_s::ms, numbots, qfalse, qtrue, trap_BotFreeGoalState(), trap_BotFreeMoveState(), trap_BotFreeWeaponState(), and bot_state_s::ws.

Referenced by BotAIShutdown(), and ClientDisconnect().

00891                                                       {
00892         bot_state_t *bs;
00893 
00894         bs = botstates[client];
00895         if (!bs || !bs->inuse) {
00896                 //BotAI_Print(PRT_ERROR, "BotAIShutdownClient: client %d already shutdown\n", client);
00897                 return qfalse;
00898         }
00899 
00900         trap_BotFreeMoveState(bs->ms);
00901         //free the goal state`                  
00902         trap_BotFreeGoalState(bs->gs);
00903         //free the weapon weights
00904         trap_BotFreeWeaponState(bs->ws);
00905         //
00906         //clear the bot state
00907         memset(bs, 0, sizeof(bot_state_t));
00908         //set the inuse flag to qfalse
00909         bs->inuse = qfalse;
00910         //there's one bot less
00911         numbots--;
00912         //everything went ok
00913         return qtrue;
00914 }

int BotAIStartFrame int  time  ) 
 

Definition at line 7492 of file ai_main.c.

References bot_attachments, bot_camp, bot_forgimmick, bot_getinthecarrr, bot_honorableduelacceptance, bot_pvstype, BOT_THINK_TIME, bot_wp_info, BotAI(), BotScheduleBotThink(), botstates, bot_state_s::botthink_residual, BotUpdateInput(), BotWaypointRender(), client, gentity_s::client, CON_CONNECTED, clientPersistant_t::connected, G_CheckBotSpawn(), g_entities, gBotEdit, gUpdateVars, bot_state_s::inuse, level, MAX_CLIENTS, gclient_s::pers, qtrue, level_locals_t::time, trap_BotUserCommand(), trap_Cvar_Update(), and UpdateEventTracker().

Referenced by vmMain().

07492                               {
07493         int i;
07494         int elapsed_time, thinktime;
07495         static int local_time;
07496         static int botlib_residual;
07497         static int lastbotthink_time;
07498 
07499         if (gUpdateVars < level.time)
07500         {
07501                 trap_Cvar_Update(&bot_pvstype);
07502                 trap_Cvar_Update(&bot_camp);
07503                 trap_Cvar_Update(&bot_attachments);
07504                 trap_Cvar_Update(&bot_forgimmick);
07505                 trap_Cvar_Update(&bot_honorableduelacceptance);
07506 #ifndef FINAL_BUILD
07507                 trap_Cvar_Update(&bot_getinthecarrr);
07508 #endif
07509                 gUpdateVars = level.time + 1000;
07510         }
07511 
07512         G_CheckBotSpawn();
07513 
07514         //rww - addl bot frame functions
07515         if (gBotEdit)
07516         {
07517                 trap_Cvar_Update(&bot_wp_info);
07518                 BotWaypointRender();
07519         }
07520 
07521         UpdateEventTracker();
07522         //end rww
07523 
07524         //cap the bot think time
07525         //if the bot think time changed we should reschedule the bots
07526         if (BOT_THINK_TIME != lastbotthink_time) {
07527                 lastbotthink_time = BOT_THINK_TIME;
07528                 BotScheduleBotThink();
07529         }
07530 
07531         elapsed_time = time - local_time;
07532         local_time = time;
07533 
07534         if (elapsed_time > BOT_THINK_TIME) thinktime = elapsed_time;
07535         else thinktime = BOT_THINK_TIME;
07536 
07537         // execute scheduled bot AI
07538         for( i = 0; i < MAX_CLIENTS; i++ ) {
07539                 if( !botstates[i] || !botstates[i]->inuse ) {
07540                         continue;
07541                 }
07542                 //
07543                 botstates[i]->botthink_residual += elapsed_time;
07544                 //
07545                 if ( botstates[i]->botthink_residual >= thinktime ) {
07546                         botstates[i]->botthink_residual -= thinktime;
07547 
07548                         if (g_entities[i].client->pers.connected == CON_CONNECTED) {
07549                                 BotAI(i, (float) thinktime / 1000);
07550                         }
07551                 }
07552         }
07553 
07554         // execute bot user commands every frame
07555         for( i = 0; i < MAX_CLIENTS; i++ ) {
07556                 if( !botstates[i] || !botstates[i]->inuse ) {
07557                         continue;
07558                 }
07559                 if( g_entities[i].client->pers.connected != CON_CONNECTED ) {
07560                         continue;
07561                 }
07562 
07563                 BotUpdateInput(botstates[i], time, elapsed_time);
07564                 trap_BotUserCommand(botstates[i]->client, &botstates[i]->lastucmd);
07565         }
07566 
07567         return qtrue;
07568 }

void BotInterbreedEndMatch void   ) 
 

void BotOrder gentity_t ent,
int  clientnum,
int  ordernum
 

Definition at line 184 of file ai_main.c.

References BotDoChat(), BotReportStatus(), botstates, BotStraightTPOrderCheck(), bot_state_s::chatAltObject, bot_state_s::chatObject, bot_state_s::chatTeam, gentity_s::client, CTFSTATE_MAXCTFSTATES, CTFSTATE_NONE, g_entities, g_gametype, gentity_t, GT_CTF, GT_CTY, GT_SIEGE, GT_TEAM, vmCvar_t::integer, MAX_CLIENTS, NULL, OnSameTeam(), gclient_s::sess, SIEGESTATE_MAXSIEGESTATES, SIEGESTATE_NONE, bot_state_s::state_Forced, clientSession_t::teamLeader, TEAMPLAYSTATE_MAXTPSTATES, and TEAMPLAYSTATE_NONE.

00185 {
00186         int stateMin = 0;
00187         int stateMax = 0;
00188         int i = 0;
00189 
00190         if (!ent || !ent->client || !ent->client->sess.teamLeader)
00191         {
00192                 return;
00193         }
00194 
00195         if (clientnum != -1 && !botstates[clientnum])
00196         {
00197                 return;
00198         }
00199 
00200         if (clientnum != -1 && !OnSameTeam(ent, &g_entities[clientnum]))
00201         {
00202                 return;
00203         }
00204 
00205         if (g_gametype.integer != GT_CTF && g_gametype.integer != GT_CTY && g_gametype.integer != GT_SIEGE &&
00206                 g_gametype.integer != GT_TEAM)
00207         {
00208                 return;
00209         }
00210 
00211         if (g_gametype.integer == GT_CTF || g_gametype.integer == GT_CTY)
00212         {
00213                 stateMin = CTFSTATE_NONE;
00214                 stateMax = CTFSTATE_MAXCTFSTATES;
00215         }
00216         else if (g_gametype.integer == GT_SIEGE)
00217         {
00218                 stateMin = SIEGESTATE_NONE;
00219                 stateMax = SIEGESTATE_MAXSIEGESTATES;
00220         }
00221         else if (g_gametype.integer == GT_TEAM)
00222         {
00223                 stateMin = TEAMPLAYSTATE_NONE;
00224                 stateMax = TEAMPLAYSTATE_MAXTPSTATES;
00225         }
00226 
00227         if ((ordernum < stateMin && ordernum != -1) || ordernum >= stateMax)
00228         {
00229                 return;
00230         }
00231 
00232         if (clientnum != -1)
00233         {
00234                 if (ordernum == -1)
00235                 {
00236                         BotReportStatus(botstates[clientnum]);
00237                 }
00238                 else
00239                 {
00240                         BotStraightTPOrderCheck(ent, ordernum, botstates[clientnum]);
00241                         botstates[clientnum]->state_Forced = ordernum;
00242                         botstates[clientnum]->chatObject = ent;
00243                         botstates[clientnum]->chatAltObject = NULL;
00244                         if (BotDoChat(botstates[clientnum], "OrderAccepted", 1))
00245                         {
00246                                 botstates[clientnum]->chatTeam = 1;
00247                         }
00248                 }
00249         }
00250         else
00251         {
00252                 while (i < MAX_CLIENTS)
00253                 {
00254                         if (botstates[i] && OnSameTeam(ent, &g_entities[i]))
00255                         {
00256                                 if (ordernum == -1)
00257                                 {
00258                                         BotReportStatus(botstates[i]);
00259                                 }
00260                                 else
00261                                 {
00262                                         BotStraightTPOrderCheck(ent, ordernum, botstates[i]);
00263                                         botstates[i]->state_Forced = ordernum;
00264                                         botstates[i]->chatObject = ent;
00265                                         botstates[i]->chatAltObject = NULL;
00266                                         if (BotDoChat(botstates[i], "OrderAccepted", 0))
00267                                         {
00268                                                 botstates[i]->chatTeam = 1;
00269                                         }
00270                                 }
00271                         }
00272 
00273                         i++;
00274                 }
00275         }
00276 }

void BroadcastTeamChange gclient_t client,
int  oldTeam
 

Definition at line 579 of file g_cmds.c.

References client, level_locals_t::clients, playerState_s::fd, forcedata_s::forceDoInit, g_gametype, G_GetStringEdString(), G_LogPrintf(), gclient_t, GT_DUEL, GT_POWERDUEL, GT_SIEGE, vmCvar_t::integer, level, clientPersistant_t::netname, gclient_s::pers, gclient_s::ps, S_COLOR_WHITE, gclient_s::sess, clientSession_t::sessionTeam, TEAM_BLUE, TEAM_FREE, TEAM_RED, TEAM_SPECTATOR, TeamName(), trap_SendServerCommand(), and va().

Referenced by ClientConnect(), G_InitSessionData(), and SetTeam().

00580 {
00581         client->ps.fd.forceDoInit = 1; //every time we change teams make sure our force powers are set right
00582 
00583         if (g_gametype.integer == GT_SIEGE)
00584         { //don't announce these things in siege
00585                 return;
00586         }
00587 
00588         if ( client->sess.sessionTeam == TEAM_RED ) {
00589                 trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s\n\"",
00590                         client->pers.netname, G_GetStringEdString("MP_SVGAME", "JOINEDTHEREDTEAM")) );
00591         } else if ( client->sess.sessionTeam == TEAM_BLUE ) {
00592                 trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s\n\"",
00593                 client->pers.netname, G_GetStringEdString("MP_SVGAME", "JOINEDTHEBLUETEAM")));
00594         } else if ( client->sess.sessionTeam == TEAM_SPECTATOR && oldTeam != TEAM_SPECTATOR ) {
00595                 trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s\n\"",
00596                 client->pers.netname, G_GetStringEdString("MP_SVGAME", "JOINEDTHESPECTATORS")));
00597         } else if ( client->sess.sessionTeam == TEAM_FREE ) {
00598                 if (g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL)
00599                 {
00600                         /*
00601                         gentity_t *currentWinner = G_GetDuelWinner(client);
00602 
00603                         if (currentWinner && currentWinner->client)
00604                         {
00605                                 trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s %s\n\"",
00606                                 currentWinner->client->pers.netname, G_GetStringEdString("MP_SVGAME", "VERSUS"), client->pers.netname));
00607                         }
00608                         else
00609                         {
00610                                 trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s\n\"",
00611                                 client->pers.netname, G_GetStringEdString("MP_SVGAME", "JOINEDTHEBATTLE")));
00612                         }
00613                         */
00614                         //NOTE: Just doing a vs. once it counts two players up
00615                 }
00616                 else
00617                 {
00618                         trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s\n\"",
00619                         client->pers.netname, G_GetStringEdString("MP_SVGAME", "JOINEDTHEBATTLE")));
00620                 }
00621         }
00622 
00623         G_LogPrintf ( "setteam:  %i %s %s\n",
00624                                   client - &level.clients[0],
00625                                   TeamName ( oldTeam ),
00626                                   TeamName ( client->sess.sessionTeam ) );
00627 }

const char* BuildShaderStateConfig void   ) 
 

Definition at line 39 of file g_utils.c.

References Com_sprintf(), MAX_QPATH, MAX_STRING_CHARS, memset(), Q_strcat(), remapCount, and remappedShaders.

Referenced by G_RemapTeamShaders(), and G_UseTargets2().

00039                                          {
00040         static char     buff[MAX_STRING_CHARS*4];
00041         char out[(MAX_QPATH * 2) + 5];
00042         int i;
00043   
00044         memset(buff, 0, MAX_STRING_CHARS);
00045         for (i = 0; i < remapCount; i++) {
00046                 Com_sprintf(out, (MAX_QPATH * 2) + 5, "%s=%s:%5.2f@", remappedShaders[i].oldShader, remappedShaders[i].newShader, remappedShaders[i].timeOffset);
00047                 Q_strcat( buff, sizeof( buff ), out);
00048         }
00049         return buff;
00050 }

void CalcMuzzlePoint gentity_t ent,
vec3_t  forward,
vec3_t  right,
vec3_t  up,
vec3_t  muzzlePoint
 

Definition at line 3525 of file g_weapon.c.

References gentity_s::client, gentity_t, entityState_s::pos, gclient_s::ps, gentity_s::s, trajectory_t::trBase, vec3_t, VectorCopy, VectorMA, playerState_s::viewheight, entityState_s::weapon, WP_MuzzlePoint, WP_NONE, and WP_NUM_WEAPONS.

Referenced by CalcEntitySpot(), FireWeapon(), NPC_BSSniper_Attack(), Sniper_FaceEnemy(), and WP_DropDetPack().

03526 {
03527         int weapontype;
03528         vec3_t muzzleOffPoint;
03529 
03530         weapontype = ent->s.weapon;
03531         VectorCopy( ent->s.pos.trBase, muzzlePoint );
03532 
03533         VectorCopy(WP_MuzzlePoint[weapontype], muzzleOffPoint);
03534 
03535         if (weapontype > WP_NONE && weapontype < WP_NUM_WEAPONS)
03536         {       // Use the table to generate the muzzlepoint;
03537                 {       // Crouching.  Use the add-to-Z method to adjust vertically.
03538                         VectorMA(muzzlePoint, muzzleOffPoint[0], forward, muzzlePoint);
03539                         VectorMA(muzzlePoint, muzzleOffPoint[1], right, muzzlePoint);
03540                         muzzlePoint[2] += ent->client->ps.viewheight + muzzleOffPoint[2];
03541                 }
03542         }
03543 
03544         // snap to integer coordinates for more efficient network bandwidth usage
03545         SnapVector( muzzlePoint );
03546 }

void CalculateRanks void   ) 
 

Definition at line 1735 of file g_main.c.

References CheckExitRules(), level_locals_t::clients, CON_CONNECTED, CON_DISCONNECTED, clientPersistant_t::connected, CS_CLIENT_DUELWINNER, CS_SCORES1, CS_SCORES2, level_locals_t::follow1, level_locals_t::follow2, g_entities, g_gametype, gclient_t, gQueueScoreMessage, gQueueScoreMessageTime, GT_DUEL, GT_POWERDUEL, GT_SINGLE_PLAYER, GT_TEAM, gclient_s::iAmALoser, vmCvar_t::integer, level_locals_t::intermissiontime, level, level_locals_t::maxclients, level_locals_t::numConnectedClients, level_locals_t::numNonSpectatorClients, level_locals_t::numPlayingClients, level_locals_t::numteamVotingClients, level_locals_t::numVotingClients, gclient_s::pers, PERS_RANK, PERS_SCORE, playerState_s::persistant, gclient_s::ps, qsort(), qtrue, gentity_s::r, RANK_TIED_FLAG, SCORE_NOT_PRESENT, gclient_s::sess, clientSession_t::sessionTeam, level_locals_t::sortedClients, SortRanks(), SVF_BOT, entityShared_t::svFlags, TEAM_BLUE, TEAM_NUM_TEAMS, TEAM_RED, TEAM_SPECTATOR, level_locals_t::teamScores, level_locals_t::time, trap_SetConfigstring(), va(), and level_locals_t::warmupTime.

Referenced by AddScore(), ClientBegin(), ClientConnect(), ClientDisconnect(), RemovePowerDuelLosers(), Team_TouchOurFlag(), and UpdateTournamentInfo().

01735                             {
01736         int             i;
01737         int             rank;
01738         int             score;
01739         int             newScore;
01740         int             preNumSpec = 0;
01741         //int           nonSpecIndex = -1;
01742         gclient_t       *cl;
01743 
01744         preNumSpec = level.numNonSpectatorClients;
01745 
01746         level.follow1 = -1;
01747         level.follow2 = -1;
01748         level.numConnectedClients = 0;
01749         level.numNonSpectatorClients = 0;
01750         level.numPlayingClients = 0;
01751         level.numVotingClients = 0;             // don't count bots
01752         for ( i = 0; i < TEAM_NUM_TEAMS; i++ ) {
01753                 level.numteamVotingClients[i] = 0;
01754         }
01755         for ( i = 0 ; i < level.maxclients ; i++ ) {
01756                 if ( level.clients[i].pers.connected != CON_DISCONNECTED ) {
01757                         level.sortedClients[level.numConnectedClients] = i;
01758                         level.numConnectedClients++;
01759 
01760                         if ( level.clients[i].sess.sessionTeam != TEAM_SPECTATOR || g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL )
01761                         {
01762                                 if (level.clients[i].sess.sessionTeam != TEAM_SPECTATOR)
01763                                 {
01764                                         level.numNonSpectatorClients++;
01765                                         //nonSpecIndex = i;
01766                                 }
01767                         
01768                                 // decide if this should be auto-followed
01769                                 if ( level.clients[i].pers.connected == CON_CONNECTED )
01770                                 {
01771                                         if (level.clients[i].sess.sessionTeam != TEAM_SPECTATOR || level.clients[i].iAmALoser)
01772                                         {
01773                                                 level.numPlayingClients++;
01774                                         }
01775                                         if ( !(g_entities[i].r.svFlags & SVF_BOT) )
01776                                         {
01777                                                 level.numVotingClients++;
01778                                                 if ( level.clients[i].sess.sessionTeam == TEAM_RED )
01779                                                         level.numteamVotingClients[0]++;
01780                                                 else if ( level.clients[i].sess.sessionTeam == TEAM_BLUE )
01781                                                         level.numteamVotingClients[1]++;
01782                                         }
01783                                         if ( level.follow1 == -1 ) {
01784                                                 level.follow1 = i;
01785                                         } else if ( level.follow2 == -1 ) {
01786                                                 level.follow2 = i;
01787                                         }
01788                                 }
01789                         }
01790                 }
01791         }
01792 
01793         //if (!g_warmup.integer)
01794         if (1)
01795         {
01796                 level.warmupTime = 0;
01797         }
01798 
01799         /*
01800         if (level.numNonSpectatorClients == 2 && preNumSpec < 2 && nonSpecIndex != -1 && g_gametype.integer == GT_DUEL && !level.warmupTime)
01801         {
01802                 gentity_t *currentWinner = G_GetDuelWinner(&level.clients[nonSpecIndex]);
01803 
01804                 if (currentWinner && currentWinner->client)
01805                 {
01806                         trap_SendServerCommand( -1, va("cp \"%s" S_COLOR_WHITE " %s %s\n\"",
01807                         currentWinner->client->pers.netname, G_GetStringEdString("MP_SVGAME", "VERSUS"), level.clients[nonSpecIndex].pers.netname));
01808                 }
01809         }
01810         */
01811         //NOTE: for now not doing this either. May use later if appropriate.
01812 
01813         qsort( level.sortedClients, level.numConnectedClients, 
01814                 sizeof(level.sortedClients[0]), SortRanks );
01815 
01816         // set the rank value for all clients that are connected and not spectators
01817         if ( g_gametype.integer >= GT_TEAM ) {
01818                 // in team games, rank is just the order of the teams, 0=red, 1=blue, 2=tied
01819                 for ( i = 0;  i < level.numConnectedClients; i++ ) {
01820                         cl = &level.clients[ level.sortedClients[i] ];
01821                         if ( level.teamScores[TEAM_RED] == level.teamScores[TEAM_BLUE] ) {
01822                                 cl->ps.persistant[PERS_RANK] = 2;
01823                         } else if ( level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE] ) {
01824                                 cl->ps.persistant[PERS_RANK] = 0;
01825                         } else {
01826                                 cl->ps.persistant[PERS_RANK] = 1;
01827                         }
01828                 }
01829         } else {        
01830                 rank = -1;
01831                 score = 0;
01832                 for ( i = 0;  i < level.numPlayingClients; i++ ) {
01833                         cl = &level.clients[ level.sortedClients[i] ];
01834                         newScore = cl->ps.persistant[PERS_SCORE];
01835                         if ( i == 0 || newScore != score ) {
01836                                 rank = i;
01837                                 // assume we aren't tied until the next client is checked
01838                                 level.clients[ level.sortedClients[i] ].ps.persistant[PERS_RANK] = rank;
01839                         } else {
01840                                 // we are tied with the previous client
01841                                 level.clients[ level.sortedClients[i-1] ].ps.persistant[PERS_RANK] = rank | RANK_TIED_FLAG;
01842                                 level.clients[ level.sortedClients[i] ].ps.persistant[PERS_RANK] = rank | RANK_TIED_FLAG;
01843                         }
01844                         score = newScore;
01845                         if ( g_gametype.integer == GT_SINGLE_PLAYER && level.numPlayingClients == 1 ) {
01846                                 level.clients[ level.sortedClients[i] ].ps.persistant[PERS_RANK] = rank | RANK_TIED_FLAG;
01847                         }
01848                 }
01849         }
01850 
01851         // set the CS_SCORES1/2 configstrings, which will be visible to everyone
01852         if ( g_gametype.integer >= GT_TEAM ) {
01853                 trap_SetConfigstring( CS_SCORES1, va("%i", level.teamScores[TEAM_RED] ) );
01854                 trap_SetConfigstring( CS_SCORES2, va("%i", level.teamScores[TEAM_BLUE] ) );
01855         } else {
01856                 if ( level.numConnectedClients == 0 ) {
01857                         trap_SetConfigstring( CS_SCORES1, va("%i", SCORE_NOT_PRESENT) );
01858                         trap_SetConfigstring( CS_SCORES2, va("%i", SCORE_NOT_PRESENT) );
01859                 } else if ( level.numConnectedClients == 1 ) {
01860                         trap_SetConfigstring( CS_SCORES1, va("%i", level.clients[ level.sortedClients[0] ].ps.persistant[PERS_SCORE] ) );
01861                         trap_SetConfigstring( CS_SCORES2, va("%i", SCORE_NOT_PRESENT) );
01862                 } else {
01863                         trap_SetConfigstring( CS_SCORES1, va("%i", level.clients[ level.sortedClients[0] ].ps.persistant[PERS_SCORE] ) );
01864                         trap_SetConfigstring( CS_SCORES2, va("%i", level.clients[ level.sortedClients[1] ].ps.persistant[PERS_SCORE] ) );
01865                 }
01866 
01867                 if (g_gametype.integer != GT_DUEL || g_gametype.integer != GT_POWERDUEL)
01868                 { //when not in duel, use this configstring to pass the index of the player currently in first place
01869                         if ( level.numConnectedClients >= 1 )
01870                         {
01871                                 trap_SetConfigstring ( CS_CLIENT_DUELWINNER, va("%i", level.sortedClients[0] ) );
01872                         }
01873                         else
01874                         {
01875                                 trap_SetConfigstring ( CS_CLIENT_DUELWINNER, "-1" );
01876                         }
01877                 }
01878         }
01879 
01880         // see if it is time to end the level
01881         CheckExitRules();
01882 
01883         // if we are at the intermission or in multi-frag Duel game mode, send the new info to everyone
01884         if ( level.intermissiontime || g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL ) {
01885                 gQueueScoreMessage = qtrue;
01886                 gQueueScoreMessageTime = level.time + 500;
01887                 //SendScoreboardMessageToAllClients();
01888                 //rww - Made this operate on a "queue" system because it was causing large overflows
01889         }
01890 }

qboolean CanDamage gentity_t targ,
vec3_t  origin
 

Definition at line 5510 of file g_combat.c.

References entityShared_t::absmax, entityShared_t::absmin, trace_t::entityNum, ENTITYNUM_NONE, trace_t::fraction, gentity_t, MASK_SOLID, entityState_s::number, qboolean, qfalse, qtrue, gentity_s::r, gentity_s::s, trap_Trace(), vec3_origin, vec3_t, VectorAdd, VectorCopy, and VectorScale.

Referenced by G_RadiusDamage().

05510                                                     {
05511         vec3_t  dest;
05512         trace_t tr;
05513         vec3_t  midpoint;
05514 
05515         // use the midpoint of the bounds instead of the origin, because
05516         // bmodels may have their origin is 0,0,0
05517         VectorAdd (targ->r.absmin, targ->r.absmax, midpoint);
05518         VectorScale (midpoint, 0.5, midpoint);
05519 
05520         VectorCopy (midpoint, dest);
05521         trap_Trace ( &tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
05522         if (tr.fraction == 1.0 || tr.entityNum == targ->s.number)
05523                 return qtrue;
05524 
05525         // this should probably check in the plane of projection, 
05526         // rather than in world coordinate, and also include Z
05527         VectorCopy (midpoint, dest);
05528         dest[0] += 15.0;
05529         dest[1] += 15.0;
05530         trap_Trace ( &tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
05531         if (tr.fraction == 1.0)
05532                 return qtrue;
05533 
05534         VectorCopy (midpoint, dest);
05535         dest[0] += 15.0;
05536         dest[1] -= 15.0;
05537         trap_Trace ( &tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
05538         if (tr.fraction == 1.0)
05539                 return qtrue;
05540 
05541         VectorCopy (midpoint, dest);
05542         dest[0] -= 15.0;
05543         dest[1] += 15.0;
05544         trap_Trace ( &tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
05545         if (tr.fraction == 1.0)
05546                 return qtrue;
05547 
05548         VectorCopy (midpoint, dest);
05549         dest[0] -= 15.0;
05550         dest[1] -= 15.0;
05551         trap_Trace ( &tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
05552         if (tr.fraction == 1.0)
05553                 return qtrue;
05554 
05555 
05556         return qfalse;
05557 }

qboolean CheckGauntletAttack gentity_t ent  ) 
 

void CheckTeamLeader int  team  ) 
 

Definition at line 3361 of file g_main.c.

References level_locals_t::clients, g_entities, level, level_locals_t::maxclients, qtrue, gentity_s::r, gclient_s::sess, clientSession_t::sessionTeam, SVF_BOT, entityShared_t::svFlags, and clientSession_t::teamLeader.

Referenced by SetTeam().

03361                                  {
03362         int i;
03363 
03364         for ( i = 0 ; i < level.maxclients ; i++ ) {
03365                 if (level.clients[i].sess.sessionTeam != team)
03366                         continue;
03367                 if (level.clients[i].sess.teamLeader)
03368                         break;
03369         }
03370         if (i >= level.maxclients) {
03371                 for ( i = 0 ; i < level.maxclients ; i++ ) {
03372                         if (level.clients[i].sess.sessionTeam != team)
03373                                 continue;
03374                         if (!(g_entities[i].r.svFlags & SVF_BOT)) {
03375                                 level.clients[i].sess.teamLeader = qtrue;
03376                                 break;
03377                         }
03378                 }
03379                 for ( i = 0 ; i < level.maxclients ; i++ ) {
03380                         if (level.clients[i].sess.sessionTeam != team)
03381                                 continue;
03382                         level.clients[i].sess.teamLeader = qtrue;
03383                         break;
03384                 }
03385         }
03386 }

void ClearRegisteredItems void   ) 
 

Definition at line 2998 of file g_items.c.

References BG_FindItemForWeapon(), g_gametype, G_PrecacheDispensers(), GT_SIEGE, vmCvar_t::integer, itemRegistered, memset(), RegisterItem(), WP_BRYAR_PISTOL, WP_MELEE, WP_SABER, and WP_STUN_BATON.

Referenced by G_InitGame().

02998                                   {
02999         memset( itemRegistered, 0, sizeof( itemRegistered ) );
03000 
03001         // players always start with the base weapon
03002         RegisterItem( BG_FindItemForWeapon( WP_BRYAR_PISTOL ) );
03003         RegisterItem( BG_FindItemForWeapon( WP_STUN_BATON ) );
03004         RegisterItem( BG_FindItemForWeapon( WP_MELEE ) );
03005         RegisterItem( BG_FindItemForWeapon( WP_SABER ) );
03006 
03007         if (g_gametype.integer == GT_SIEGE)
03008         { //kind of cheesy, maybe check if siege class with disp's is gonna be on this map too
03009                 G_PrecacheDispensers();
03010         }
03011 }

void ClientBegin int  clientNum,
qboolean  allowTeamReset
 

Definition at line 2385 of file g_client.c.

References CalculateRanks(), CHAN_VOICE, gentity_s::client, client, entityState_s::clientNum, level_locals_t::clients, ClientSpawn(), ClientUserinfoChanged(), CON_CONNECTED, clientPersistant_t::connected, clientSession_t::duelTeam, DUELTEAM_FREE, playerState_s::eFlags, clientPersistant_t::enterTime, EV_PLAYER_TELEPORT_IN, playerState_s::fd, forcedata_s::forcePowersActive, G_ClearClientLog(), g_entities, g_gametype, G_GetStringEdString(), G_InitGentity(), G_LogPrintf(), G_MuteSound(), G_ReadSessionData(), G_SetSaber(), G_TempEntity(), G_WriteClientSessionData(), gclient_t, gentity_t, gentity_s::ghoul2, gSiegeRoundBegun, gSiegeRoundEnded, GT_DUEL, GT_POWERDUEL, GT_SIEGE, GT_TEAM, playerState_s::hasDetPackPlanted, Info_SetValueForKey(), Info_ValueForKey(), vmCvar_t::integer, forcedata_s::killSoundEntIndex, renderInfo_s::lastG2, level, entityShared_t::linked, MAX_GENTITIES, MAX_INFO_STRING, MAX_INFO_VALUE, memset(), clientPersistant_t::netname, NULL, NUM_FORCE_POWERS, NUM_TRACK_CHANNELS, playerState_s::origin, gentity_s::pain, gclient_s::pers, PERS_TEAM, playerState_s::persistant, PickTeam(), gentity_s::playerState, gclient_s::ps, qfalse, gentity_s::r, rand(), gclient_s::renderInfo, gentity_s::s, S_COLOR_WHITE, gclient_s::sess, clientSession_t::sessionTeam, SetTeam(), SetTeamQuick(), SetupGameGhoul2Model(), playerTeamState_t::state, strcpy(), SVF_BOT, entityShared_t::svFlags, TEAM_BEGIN, TEAM_RED, TEAM_SPECTATOR, clientPersistant_t::teamState, level_locals_t::time, gentity_s::touch, TRACK_CHANNEL_1, trap_GetUserinfo(), trap_SendServerCommand(), trap_SetUserinfo(), trap_UnlinkEntity(), va(), WP_ForcePowerStop(), WP_InitForcePowers(), and WP_SaberInitBladeData().

Referenced by Cmd_SiegeClass_f(), G_CheckBotSpawn(), SetTeam(), SetTeamQuick(), SpectatorClientEndFrame(), and vmMain().

02385                                                            {
02386         gentity_t       *ent;
02387         gclient_t       *client;
02388         gentity_t       *tent;
02389         int                     flags, i;
02390         char            userinfo[MAX_INFO_VALUE], *modelname;
02391 
02392         ent = g_entities + clientNum;
02393 
02394         if ((ent->r.svFlags & SVF_BOT) && g_gametype.integer >= GT_TEAM)
02395         {
02396                 if (allowTeamReset)
02397                 {
02398                         const char *team = "Red";
02399                         int preSess;
02400 
02401                         //SetTeam(ent, "");
02402                         ent->client->sess.sessionTeam = PickTeam(-1);
02403                         trap_GetUserinfo(clientNum, userinfo, MAX_INFO_STRING);
02404 
02405                         if (ent->client->sess.sessionTeam == TEAM_SPECTATOR)
02406                         {
02407                                 ent->client->sess.sessionTeam = TEAM_RED;
02408                         }
02409 
02410                         if (ent->client->sess.sessionTeam == TEAM_RED)
02411                         {
02412                                 team = "Red";
02413                         }
02414                         else
02415                         {
02416                                 team = "Blue";
02417                         }
02418 
02419                         Info_SetValueForKey( userinfo, "team", team );
02420 
02421                         trap_SetUserinfo( clientNum, userinfo );
02422 
02423                         ent->client->ps.persistant[ PERS_TEAM ] = ent->client->sess.sessionTeam;
02424 
02425                         preSess = ent->client->sess.sessionTeam;
02426                         G_ReadSessionData( ent->client );
02427                         ent->client->sess.sessionTeam = preSess;
02428                         G_WriteClientSessionData(ent->client);
02429                         ClientUserinfoChanged( clientNum );
02430                         ClientBegin(clientNum, qfalse);
02431                         return;
02432                 }
02433         }
02434 
02435         client = level.clients + clientNum;
02436 
02437         if ( ent->r.linked ) {
02438                 trap_UnlinkEntity( ent );
02439         }
02440         G_InitGentity( ent );
02441         ent->touch = 0;
02442         ent->pain = 0;
02443         ent->client = client;
02444 
02445         //assign the pointer for bg entity access
02446         ent->playerState = &ent->client->ps;
02447 
02448         client->pers.connected = CON_CONNECTED;
02449         client->pers.enterTime = level.time;
02450         client->pers.teamState.state = TEAM_BEGIN;
02451 
02452         // save eflags around this, because changing teams will
02453         // cause this to happen with a valid entity, and we
02454         // want to make sure the teleport bit is set right
02455         // so the viewpoint doesn't interpolate through the
02456         // world to the new position
02457         flags = client->ps.eFlags;
02458 
02459         i = 0;
02460 
02461         while (i < NUM_FORCE_POWERS)
02462         {
02463                 if (ent->client->ps.fd.forcePowersActive & (1 << i))
02464                 {
02465                         WP_ForcePowerStop(ent, i);
02466                 }
02467                 i++;
02468         }
02469 
02470         i = TRACK_CHANNEL_1;
02471 
02472         while (i < NUM_TRACK_CHANNELS)
02473         {
02474                 if (ent->client->ps.fd.killSoundEntIndex[i-50] && ent->client->ps.fd.killSoundEntIndex[i-50] < MAX_GENTITIES && ent->client->ps.fd.killSoundEntIndex[i-50] > 0)
02475                 {
02476                         G_MuteSound(ent->client->ps.fd.killSoundEntIndex[i-50], CHAN_VOICE);
02477                 }
02478                 i++;
02479         }
02480         i = 0;
02481 
02482         memset( &client->ps, 0, sizeof( client->ps ) );
02483         client->ps.eFlags = flags;
02484 
02485         client->ps.hasDetPackPlanted = qfalse;
02486 
02487         //first-time force power initialization
02488         WP_InitForcePowers( ent );
02489 
02490         //init saber ent
02491         WP_SaberInitBladeData( ent );
02492 
02493         // First time model setup for that player.
02494         trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
02495         modelname = Info_ValueForKey (userinfo, "model");
02496         SetupGameGhoul2Model(ent, modelname, NULL);
02497 
02498         if (ent->ghoul2 && ent->client)
02499         {
02500                 ent->client->renderInfo.lastG2 = NULL; //update the renderinfo bolts next update.
02501         }
02502 
02503         if (g_gametype.integer == GT_POWERDUEL && client->sess.sessionTeam != TEAM_SPECTATOR &&
02504                 client->sess.duelTeam == DUELTEAM_FREE)
02505         {
02506                 SetTeam(ent, "s");
02507         }
02508         else
02509         {
02510                 if (g_gametype.integer == GT_SIEGE && (!gSiegeRoundBegun || gSiegeRoundEnded))
02511                 {
02512                         SetTeamQuick(ent, TEAM_SPECTATOR, qfalse);
02513                 }
02514         
02515                 if ((ent->r.svFlags & SVF_BOT) &&
02516                         g_gametype.integer != GT_SIEGE)
02517                 {
02518                         char *saberVal = Info_ValueForKey(userinfo, "saber1");
02519                         char *saber2Val = Info_ValueForKey(userinfo, "saber2");
02520 
02521                         if (!saberVal || !saberVal[0])
02522                         { //blah, set em up with a random saber
02523                                 int r = rand()%50;
02524                                 char sab1[1024];
02525                                 char sab2[1024];
02526 
02527                                 if (r <= 17)
02528                                 {
02529                                         strcpy(sab1, "Katarn");
02530                                         strcpy(sab2, "none");
02531                                 }
02532                                 else if (r <= 34)
02533                                 {
02534                                         strcpy(sab1, "Katarn");
02535                                         strcpy(sab2, "Katarn");
02536                                 }
02537                                 else
02538                                 {
02539                                         strcpy(sab1, "dual_1");
02540                                         strcpy(sab2, "none");
02541                                 }
02542                                 G_SetSaber(ent, 0, sab1, qfalse);
02543                                 G_SetSaber(ent, 0, sab2, qfalse);
02544                                 Info_SetValueForKey( userinfo, "saber1", sab1 );
02545                                 Info_SetValueForKey( userinfo, "saber2", sab2 );
02546                                 trap_SetUserinfo( clientNum, userinfo );
02547                         }
02548                         else
02549                         {
02550                                 G_SetSaber(ent, 0, saberVal, qfalse);
02551                         }
02552 
02553                         if (saberVal && saberVal[0] &&
02554                                 (!saber2Val || !saber2Val[0]))
02555                         {
02556                                 G_SetSaber(ent, 0, "none", qfalse);
02557                                 Info_SetValueForKey( userinfo, "saber2", "none" );
02558                                 trap_SetUserinfo( clientNum, userinfo );
02559                         }
02560                         else
02561                         {
02562                                 G_SetSaber(ent, 0, saber2Val, qfalse);
02563                         }
02564                 }
02565 
02566                 // locate ent at a spawn point
02567                 ClientSpawn( ent );
02568         }
02569 
02570         if ( client->sess.sessionTeam != TEAM_SPECTATOR ) {
02571                 // send event
02572                 tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
02573                 tent->s.clientNum = ent->s.clientNum;
02574 
02575                 if ( g_gametype.integer != GT_DUEL || g_gametype.integer == GT_POWERDUEL ) {
02576                         trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " %s\n\"", client->pers.netname, G_GetStringEdString("MP_SVGAME", "PLENTER")) );
02577                 }
02578         }
02579         G_LogPrintf( "ClientBegin: %i\n", clientNum );
02580 
02581         // count current clients and rank for scoreboard
02582         CalculateRanks();
02583 
02584         G_ClearClientLog(clientNum);
02585 }

void ClientCommand int  clientNum  ) 
 

Definition at line 3074 of file g_cmds.c.

References AcceptBotCommand(), AngleVectors(), atoi(), gclient_s::beingThrown, BG_KnockDownable(), Bot_SetForcedMovement(), BOTH_STAND1, BROKENLIMB_LARM, BROKENLIMB_RARM, CHAN_AUTO, CHAN_VOICE, CheatsOk(), gentity_s::classname, gentity_s::client, gentity_s::clipmask, Cmd_CallTeamVote_f(), Cmd_CallVote_f(), Cmd_DebugSetBodyAnim_f(), Cmd_DebugSetSaberMove_f(), Cmd_DuelTeam_f(), Cmd_Follow_f(), Cmd_FollowCycle_f(), Cmd_ForceChanged_f(), Cmd_GameCommand_f(), Cmd_Give_f(), Cmd_God_f(), Cmd_Kill_f(), Cmd_LevelShot_f(), Cmd_Noclip_f(), Cmd_Notarget_f(), Cmd_NPC_f(), Cmd_Score_f(), Cmd_SetViewpos_f(), Cmd_SiegeClass_f(), Cmd_Stats_f(), Cmd_Team_f(), Cmd_TeamTask_f(), Cmd_TeamVote_f(), Cmd_ToggleSaber_f(), Cmd_Vote_f(), Cmd_Where_f(), Com_Printf(), CONTENTS_SOLID, DismembermentByNum(), DismembermentTest(), gclient_s::doingThrow, EF_RAG, playerState_s::eFlags, trace_t::entityNum, ENTITYNUM_NONE, FL_GODMODE, gentity_s::flags, FOFS, playerState_s::forceDodgeAnim, playerState_s::forceHandExtend, playerState_s::forceHandExtendTime, trace_t::fraction, G_BreakArm(), G_CheckForDismemberment(), g_entities, G_EntitySound(), G_Find(), g_gametype, G_GetStringEdString(), G_SetVehDamageFlags(), G_Sound(), G_SoundIndex(), gentity_t, gGAvoidDismember, gentity_s::ghoul2, playerState_s::groundEntityNum, GT_TEAM, HANDEXTEND_KNOCKDOWN, HANDEXTEND_NONE, HANDEXTEND_PRETHROW, HANDEXTEND_PRETHROWN, gentity_s::health, playerState_s::heldByClient, vmCvar_t::integer, level_locals_t::intermissiontime, gentity_s::inuse, playerState_s::legsAnim, level, LS_NONE, entityState_s::m_iVehicleNum, MASK_PLAYERSOLID, MAX_CLIENTS, MAX_GENTITIES, MAX_STRING_CHARS, MAX_TOKEN_CHARS, entityShared_t::maxs, entityShared_t::mins, MOD_SUICIDE, NULL, entityState_s::number, playerState_s::origin, player_die(), gclient_s::ps, Q_stricmp(), qboolean, qfalse, qtrue, playerState_s::quickerGetup, gentity_s::r, playerState_s::ragAttach, gentity_s::s, playerState_s::saberBlocked, playerState_s::saberBlocking, playerState_s::saberEntityNum, playerState_s::saberHolstered, playerState_s::saberInFlight, saberKnockOutOfHand(), playerState_s::saberMove, SAY_ALL, SAY_TEAM, SETANIM_FLAG_HOLD, SETANIM_FLAG_HOLDLESS, SETANIM_FLAG_OVERRIDE, SetClientViewAngle(), SHIPSURF_FRONT, StandardSetBodyAnim(), trace_t::startsolid, STAT_HEALTH, playerState_s::stats, strstr(), gclient_s::throwingIndex, level_locals_t::time, trap_Argc(), trap_Argv(), trap_SendServerCommand(), trap_Trace(), trap_TrueFree(), trap_TrueMalloc(), gentity_s::use, va(), vec3_origin, vec3_t, VectorClear, VectorCopy, VectorNormalize(), VectorSubtract, vectoyaw(), playerState_s::velocity, playerState_s::viewangles, playerState_s::weapon, playerState_s::weaponTime, WP_SABER, and YAW.

Referenced by vmMain().

03074                                     {
03075         gentity_t *ent;
03076         char    cmd[MAX_TOKEN_CHARS];
03077 
03078         ent = g_entities + clientNum;
03079         if ( !ent->client ) {
03080                 return;         // not fully in game yet
03081         }
03082 
03083 
03084         trap_Argv( 0, cmd, sizeof( cmd ) );
03085 
03086         //rww - redirect bot commands
03087         if (strstr(cmd, "bot_") && AcceptBotCommand(cmd, ent))
03088         {
03089                 return;
03090         }
03091         //end rww
03092 
03093         if (Q_stricmp (cmd, "say") == 0) {
03094                 Cmd_Say_f (ent, SAY_ALL, qfalse);
03095                 return;
03096         }
03097         if (Q_stricmp (cmd, "say_team") == 0) {
03098                 if (g_gametype.integer < GT_TEAM)
03099                 { //not a team game, just refer to regular say.
03100                         Cmd_Say_f (ent, SAY_ALL, qfalse);
03101                 }
03102                 else
03103                 {
03104                         Cmd_Say_f (ent, SAY_TEAM, qfalse);
03105                 }
03106                 return;
03107         }
03108         if (Q_stricmp (cmd, "tell") == 0) {
03109                 Cmd_Tell_f ( ent );
03110                 return;
03111         }
03112 
03113         if (Q_stricmp(cmd, "voice_cmd") == 0)
03114         {
03115                 Cmd_VoiceCommand_f(ent);
03116                 return;
03117         }
03118 
03119         if (Q_stricmp (cmd, "score") == 0) {
03120                 Cmd_Score_f (ent);
03121                 return;
03122         }
03123 
03124         // ignore all other commands when at intermission
03125         if (level.intermissiontime)
03126         {
03127                 qboolean giveError = qfalse;
03128                 //rwwFIXMEFIXME: This is terrible, write it differently
03129 
03130                 if (!Q_stricmp(cmd, "give"))
03131                 {
03132                         giveError = qtrue;
03133                 }
03134                 else if (!Q_stricmp(cmd, "giveother"))
03135                 {
03136                         giveError = qtrue;
03137                 }
03138                 else if (!Q_stricmp(cmd, "god"))
03139                 {
03140                         giveError = qtrue;
03141                 }
03142                 else if (!Q_stricmp(cmd, "notarget"))
03143                 {
03144                         giveError = qtrue;
03145                 }
03146                 else if (!Q_stricmp(cmd, "noclip"))
03147                 {
03148                         giveError = qtrue;
03149                 }
03150                 else if (!Q_stricmp(cmd, "kill"))
03151                 {
03152                         giveError = qtrue;
03153                 }
03154                 else if (!Q_stricmp(cmd, "teamtask"))
03155                 {
03156                         giveError = qtrue;
03157                 }
03158                 else if (!Q_stricmp(cmd, "levelshot"))
03159                 {
03160                         giveError = qtrue;
03161                 }
03162                 else if (!Q_stricmp(cmd, "follow"))
03163                 {
03164                         giveError = qtrue;
03165                 }
03166                 else if (!Q_stricmp(cmd, "follownext"))
03167                 {
03168                         giveError = qtrue;
03169                 }
03170                 else if (!Q_stricmp(cmd, "followprev"))
03171                 {
03172                         giveError = qtrue;
03173                 }
03174                 else if (!Q_stricmp(cmd, "team"))
03175                 {
03176                         giveError = qtrue;
03177                 }
03178                 else if (!Q_stricmp(cmd, "duelteam"))
03179                 {
03180                         giveError = qtrue;
03181                 }
03182                 else if (!Q_stricmp(cmd, "siegeclass"))
03183                 {
03184                         giveError = qtrue;
03185                 }
03186                 else if (!Q_stricmp(cmd, "forcechanged"))
03187                 { //special case: still update force change
03188                         Cmd_ForceChanged_f (ent);
03189                         return;
03190                 }
03191                 else if (!Q_stricmp(cmd, "where"))
03192                 {
03193                         giveError = qtrue;
03194                 }
03195                 else if (!Q_stricmp(cmd, "callvote"))
03196                 {
03197                         giveError = qtrue;
03198                 }
03199                 else if (!Q_stricmp(cmd, "vote"))
03200                 {
03201                         giveError = qtrue;
03202                 }
03203                 else if (!Q_stricmp(cmd, "callteamvote"))
03204                 {
03205                         giveError = qtrue;
03206                 }
03207                 else if (!Q_stricmp(cmd, "teamvote"))
03208                 {
03209                         giveError = qtrue;
03210                 }
03211                 else if (!Q_stricmp(cmd, "gc"))
03212                 {
03213                         giveError = qtrue;
03214                 }
03215                 else if (!Q_stricmp(cmd, "setviewpos"))
03216                 {
03217                         giveError = qtrue;
03218                 }
03219                 else if (!Q_stricmp(cmd, "stats"))
03220                 {
03221                         giveError = qtrue;
03222                 }
03223 
03224                 if (giveError)
03225                 {
03226                         trap_SendServerCommand( clientNum, va("print \"%s (%s) \n\"", G_GetStringEdString("MP_SVGAME", "CANNOT_TASK_INTERMISSION"), cmd ) );
03227                 }
03228                 else
03229                 {
03230                         Cmd_Say_f (ent, qfalse, qtrue);
03231                 }
03232                 return;
03233         }
03234 
03235         if (Q_stricmp (cmd, "give") == 0)
03236         {
03237                 Cmd_Give_f (ent, 0);
03238         }
03239         else if (Q_stricmp (cmd, "giveother") == 0)
03240         { //for debugging pretty much
03241                 Cmd_Give_f (ent, 1);
03242         }
03243         else if (Q_stricmp (cmd, "t_use") == 0 && CheatsOk(ent))
03244         { //debug use map object
03245                 if (trap_Argc() > 1)
03246                 {
03247                         char sArg[MAX_STRING_CHARS];
03248                         gentity_t *targ;
03249 
03250                         trap_Argv( 1, sArg, sizeof( sArg ) );
03251                         targ = G_Find( NULL, FOFS(targetname), sArg );
03252 
03253                         while (targ)
03254                         {
03255                                 if (targ->use)
03256                                 {
03257                                         targ->use(targ, ent, ent);
03258                                 }
03259                                 targ = G_Find( targ, FOFS(targetname), sArg );
03260                         }
03261                 }
03262         }
03263         else if (Q_stricmp (cmd, "god") == 0)
03264                 Cmd_God_f (ent);
03265         else if (Q_stricmp (cmd, "notarget") == 0)
03266                 Cmd_Notarget_f (ent);
03267         else if (Q_stricmp (cmd, "noclip") == 0)
03268                 Cmd_Noclip_f (ent);
03269         else if ( Q_stricmp( cmd, "NPC" ) == 0 && CheatsOk(ent) )
03270         {
03271                 Cmd_NPC_f( ent );
03272         }
03273         else if (Q_stricmp (cmd, "kill") == 0)
03274                 Cmd_Kill_f (ent);
03275         else if (Q_stricmp (cmd, "teamtask") == 0)
03276                 Cmd_TeamTask_f (ent);
03277         else if (Q_stricmp (cmd, "levelshot") == 0)
03278                 Cmd_LevelShot_f (ent);
03279         else if (Q_stricmp (cmd, "follow") == 0)
03280                 Cmd_Follow_f (ent);
03281         else if (Q_stricmp (cmd, "follownext") == 0)
03282                 Cmd_FollowCycle_f (ent, 1);
03283         else if (Q_stricmp (cmd, "followprev") == 0)
03284                 Cmd_FollowCycle_f (ent, -1);
03285         else if (Q_stricmp (cmd, "team") == 0)
03286                 Cmd_Team_f (ent);
03287         else if (Q_stricmp (cmd, "duelteam") == 0)
03288                 Cmd_DuelTeam_f (ent);
03289         else if (Q_stricmp (cmd, "siegeclass") == 0)
03290                 Cmd_SiegeClass_f (ent);
03291         else if (Q_stricmp (cmd, "forcechanged") == 0)
03292                 Cmd_ForceChanged_f (ent);
03293         else if (Q_stricmp (cmd, "where") == 0)
03294                 Cmd_Where_f (ent);
03295         else if (Q_stricmp (cmd, "callvote") == 0)
03296                 Cmd_CallVote_f (ent);
03297         else if (Q_stricmp (cmd, "vote") == 0)
03298                 Cmd_Vote_f (ent);
03299         else if (Q_stricmp (cmd, "callteamvote") == 0)
03300                 Cmd_CallTeamVote_f (ent);
03301         else if (Q_stricmp (cmd, "teamvote") == 0)
03302                 Cmd_TeamVote_f (ent);
03303         else if (Q_stricmp (cmd, "gc") == 0)
03304                 Cmd_GameCommand_f( ent );
03305         else if (Q_stricmp (cmd, "setviewpos") == 0)
03306                 Cmd_SetViewpos_f( ent );
03307         else if (Q_stricmp (cmd, "stats") == 0)
03308                 Cmd_Stats_f( ent );
03309         /*
03310         else if (Q_stricmp (cmd, "kylesmash") == 0)
03311         {
03312                 TryGrapple(ent);
03313         }
03314         */
03315         //for convenient powerduel testing in release
03316         else if (Q_stricmp(cmd, "killother") == 0 && CheatsOk( ent ))
03317         {
03318                 if (trap_Argc() > 1)
03319                 {
03320                         char sArg[MAX_STRING_CHARS];
03321                         int entNum = 0;
03322 
03323                         trap_Argv( 1, sArg, sizeof( sArg ) );
03324 
03325                         entNum = G_ClientNumFromNetname(sArg);
03326 
03327                         if (entNum >= 0 && entNum < MAX_GENTITIES)
03328                         {
03329                                 gentity_t *kEnt = &g_entities[entNum];
03330 
03331                                 if (kEnt->inuse && kEnt->client)
03332                                 {
03333                                         kEnt->flags &= ~FL_GODMODE;
03334                                         kEnt->client->ps.stats[STAT_HEALTH] = kEnt->health = -999;
03335                                         player_die (kEnt, kEnt, kEnt, 100000, MOD_SUICIDE);
03336                                 }
03337                         }
03338                 }
03339         }
03340 #ifdef _DEBUG
03341         else if (Q_stricmp(cmd, "relax") == 0 && CheatsOk( ent ))
03342         {
03343                 if (ent->client->ps.eFlags & EF_RAG)
03344                 {
03345                         ent->client->ps.eFlags &= ~EF_RAG;
03346                 }
03347                 else
03348                 {
03349                         ent->client->ps.eFlags |= EF_RAG;
03350                 }
03351         }
03352         else if (Q_stricmp(cmd, "holdme") == 0 && CheatsOk( ent ))
03353         {
03354                 if (trap_Argc() > 1)
03355                 {
03356                         char sArg[MAX_STRING_CHARS];
03357                         int entNum = 0;
03358 
03359                         trap_Argv( 1, sArg, sizeof( sArg ) );
03360 
03361                         entNum = atoi(sArg);
03362 
03363                         if (entNum >= 0 &&
03364                                 entNum < MAX_GENTITIES)
03365                         {
03366                                 gentity_t *grabber = &g_entities[entNum];
03367 
03368                                 if (grabber->inuse && grabber->client && grabber->ghoul2)
03369                                 {
03370                                         if (!grabber->s.number)
03371                                         { //switch cl 0 and entitynum_none, so we can operate on the "if non-0" concept
03372                                                 ent->client->ps.ragAttach = ENTITYNUM_NONE;
03373                                         }
03374                                         else
03375                                         {
03376                                                 ent->client->ps.ragAttach = grabber->s.number;
03377                                         }
03378                                 }
03379                         }
03380                 }
03381                 else
03382                 {
03383                         ent->client->ps.ragAttach = 0;
03384                 }
03385         }
03386         else if (Q_stricmp(cmd, "limb_break") == 0 && CheatsOk( ent ))
03387         {
03388                 if (trap_Argc() > 1)
03389                 {
03390                         char sArg[MAX_STRING_CHARS];
03391                         int breakLimb = 0;
03392 
03393                         trap_Argv( 1, sArg, sizeof( sArg ) );
03394                         if (!Q_stricmp(sArg, "right"))
03395                         {
03396                                 breakLimb = BROKENLIMB_RARM;
03397                         }
03398                         else if (!Q_stricmp(sArg, "left"))
03399                         {
03400                                 breakLimb = BROKENLIMB_LARM;
03401                         }
03402 
03403                         G_BreakArm(ent, breakLimb);
03404                 }
03405         }
03406         else if (Q_stricmp(cmd, "headexplodey") == 0 && CheatsOk( ent ))
03407         {
03408                 Cmd_Kill_f (ent);
03409                 if (ent->health < 1)
03410                 {
03411                         DismembermentTest(ent);
03412                 }
03413         }
03414         else if (Q_stricmp(cmd, "debugstupidthing") == 0 && CheatsOk( ent ))
03415         {
03416                 int i = 0;
03417                 gentity_t *blah;
03418                 while (i < MAX_GENTITIES)
03419                 {
03420                         blah = &g_entities[i];
03421                         if (blah->inuse && blah->classname && blah->classname[0] && !Q_stricmp(blah->classname, "NPC_Vehicle"))
03422                         {
03423                                 Com_Printf("Found it.\n");
03424                         }
03425                         i++;
03426                 }
03427         }
03428         else if (Q_stricmp(cmd, "arbitraryprint") == 0 && CheatsOk( ent ))
03429         {
03430                 trap_SendServerCommand( -1, va("cp \"Blah blah blah\n\""));
03431         }
03432         else if (Q_stricmp(cmd, "handcut") == 0 && CheatsOk( ent ))
03433         {
03434                 int bCl = 0;
03435                 char sarg[MAX_STRING_CHARS];
03436 
03437                 if (trap_Argc() > 1)
03438                 {
03439                         trap_Argv( 1, sarg, sizeof( sarg ) );
03440 
03441                         if (sarg[0])
03442                         {
03443                                 bCl = atoi(sarg);
03444 
03445                                 if (bCl >= 0 && bCl < MAX_GENTITIES)
03446                                 {
03447                                         gentity_t *hEnt = &g_entities[bCl];
03448 
03449                                         if (hEnt->client)
03450                                         {
03451                                                 if (hEnt->health > 0)
03452                                                 {
03453                                                         gGAvoidDismember = 1;
03454                                                         hEnt->flags &= ~FL_GODMODE;
03455                                                         hEnt->client->ps.stats[STAT_HEALTH] = hEnt->health = -999;
03456                                                         player_die (hEnt, hEnt, hEnt, 100000, MOD_SUICIDE);
03457                                                 }
03458                                                 gGAvoidDismember = 2;
03459                                                 G_CheckForDismemberment(hEnt, ent, hEnt->client->ps.origin, 999, hEnt->client->ps.legsAnim, qfalse);
03460                                                 gGAvoidDismember = 0;
03461                                         }
03462                                 }
03463                         }
03464                 }
03465         }
03466         else if (Q_stricmp(cmd, "loveandpeace") == 0 && CheatsOk( ent ))
03467         {
03468                 trace_t tr;
03469                 vec3_t fPos;
03470 
03471                 AngleVectors(ent->client->ps.viewangles, fPos, 0, 0);
03472 
03473                 fPos[0] = ent->client->ps.origin[0] + fPos[0]*40;
03474                 fPos[1] = ent->client->ps.origin[1] + fPos[1]*40;
03475                 fPos[2] = ent->client->ps.origin[2] + fPos[2]*40;
03476 
03477                 trap_Trace(&tr, ent->client->ps.origin, 0, 0, fPos, ent->s.number, ent->clipmask);
03478 
03479                 if (tr.entityNum < MAX_CLIENTS && tr.entityNum != ent->s.number)
03480                 {
03481                         gentity_t *other = &g_entities[tr.entityNum];
03482 
03483                         if (other && other->inuse && other->client)
03484                         {
03485                                 vec3_t entDir;
03486                                 vec3_t otherDir;
03487                                 vec3_t entAngles;
03488                                 vec3_t otherAngles;
03489 
03490                                 if (ent->client->ps.weapon == WP_SABER && !ent->client->ps.saberHolstered)
03491                                 {
03492                                         Cmd_ToggleSaber_f(ent);
03493                                 }
03494 
03495                                 if (other->client->ps.weapon == WP_SABER && !other->client->ps.saberHolstered)
03496                                 {
03497                                         Cmd_ToggleSaber_f(other);
03498                                 }
03499 
03500                                 if ((ent->client->ps.weapon != WP_SABER || ent->client->ps.saberHolstered) &&
03501                                         (other->client->ps.weapon != WP_SABER || other->client->ps.saberHolstered))
03502                                 {
03503                                         VectorSubtract( other->client->ps.origin, ent->client->ps.origin, otherDir );
03504                                         VectorCopy( ent->client->ps.viewangles, entAngles );
03505                                         entAngles[YAW] = vectoyaw( otherDir );
03506                                         SetClientViewAngle( ent, entAngles );
03507 
03508                                         StandardSetBodyAnim(ent, /*BOTH_KISSER1LOOP*/BOTH_STAND1, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);
03509                                         ent->client->ps.saberMove = LS_NONE;
03510                                         ent->client->ps.saberBlocked = 0;
03511                                         ent->client->ps.saberBlocking = 0;
03512 
03513                                         VectorSubtract( ent->client->ps.origin, other->client->ps.origin, entDir );
03514                                         VectorCopy( other->client->ps.viewangles, otherAngles );
03515                                         otherAngles[YAW] = vectoyaw( entDir );
03516                                         SetClientViewAngle( other, otherAngles );
03517 
03518                                         StandardSetBodyAnim(other, /*BOTH_KISSEE1LOOP*/BOTH_STAND1, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS);
03519                                         other->client->ps.saberMove = LS_NONE;
03520                                         other->client->ps.saberBlocked = 0;
03521                                         other->client->ps.saberBlocking = 0;
03522                                 }
03523                         }
03524                 }
03525         }
03526 #endif
03527         else if (Q_stricmp(cmd, "thedestroyer") == 0 && CheatsOk( ent ) && ent && ent->client && ent->client->ps.saberHolstered && ent->client->ps.weapon == WP_SABER)
03528         {
03529                 Cmd_ToggleSaber_f(ent);
03530 
03531                 if (!ent->client->ps.saberHolstered)
03532                 {
03533                 }
03534         }
03535         //begin bot debug cmds
03536         else if (Q_stricmp(cmd, "debugBMove_Forward") == 0 && CheatsOk(ent))
03537         {
03538                 int arg = 4000;
03539                 int bCl = 0;
03540                 char sarg[MAX_STRING_CHARS];
03541 
03542                 assert(trap_Argc() > 1);
03543                 trap_Argv( 1, sarg, sizeof( sarg ) );
03544 
03545                 assert(sarg[0]);
03546                 bCl = atoi(sarg);
03547                 Bot_SetForcedMovement(bCl, arg, -1, -1);
03548         }
03549         else if (Q_stricmp(cmd, "debugBMove_Back") == 0 && CheatsOk(ent))
03550         {
03551                 int arg = -4000;
03552                 int bCl = 0;
03553                 char sarg[MAX_STRING_CHARS];
03554 
03555                 assert(trap_Argc() > 1);
03556                 trap_Argv( 1, sarg, sizeof( sarg ) );
03557 
03558                 assert(sarg[0]);
03559                 bCl = atoi(sarg);
03560                 Bot_SetForcedMovement(bCl, arg, -1, -1);
03561         }
03562         else if (Q_stricmp(cmd, "debugBMove_Right") == 0 && CheatsOk(ent))
03563         {
03564                 int arg = 4000;
03565                 int bCl = 0;
03566                 char sarg[MAX_STRING_CHARS];
03567 
03568                 assert(trap_Argc() > 1);
03569                 trap_Argv( 1, sarg, sizeof( sarg ) );
03570 
03571                 assert(sarg[0]);
03572                 bCl = atoi(sarg);
03573                 Bot_SetForcedMovement(bCl, -1, arg, -1);
03574         }
03575         else if (Q_stricmp(cmd, "debugBMove_Left") == 0 && CheatsOk(ent))
03576         {
03577                 int arg = -4000;
03578                 int bCl = 0;
03579                 char sarg[MAX_STRING_CHARS];
03580 
03581                 assert(trap_Argc() > 1);
03582                 trap_Argv( 1, sarg, sizeof( sarg ) );
03583 
03584                 assert(sarg[0]);
03585                 bCl = atoi(sarg);
03586                 Bot_SetForcedMovement(bCl, -1, arg, -1);
03587         }
03588         else if (Q_stricmp(cmd, "debugBMove_Up") == 0 && CheatsOk(ent))
03589         {
03590                 int arg = 4000;
03591                 int bCl = 0;
03592                 char sarg[MAX_STRING_CHARS];
03593 
03594                 assert(trap_Argc() > 1);
03595                 trap_Argv( 1, sarg, sizeof( sarg ) );
03596 
03597                 assert(sarg[0]);
03598                 bCl = atoi(sarg);
03599                 Bot_SetForcedMovement(bCl, -1, -1, arg);
03600         }
03601         //end bot debug cmds
03602 #ifndef FINAL_BUILD
03603         else if (Q_stricmp(cmd, "debugSetSaberMove") == 0)
03604         {
03605                 Cmd_DebugSetSaberMove_f(ent);
03606         }
03607         else if (Q_stricmp(cmd, "debugSetBodyAnim") == 0)
03608         {
03609                 Cmd_DebugSetBodyAnim_f(ent, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD);
03610         }
03611         else if (Q_stricmp(cmd, "debugDismemberment") == 0)
03612         {
03613                 Cmd_Kill_f (ent);
03614                 if (ent->health < 1)
03615                 {
03616                         char    arg[MAX_STRING_CHARS];
03617                         int             iArg = 0;
03618 
03619                         if (trap_Argc() > 1)
03620                         {
03621                                 trap_Argv( 1, arg, sizeof( arg ) );
03622 
03623                                 if (arg[0])
03624                                 {
03625                                         iArg = atoi(arg);
03626                                 }
03627                         }
03628 
03629                         DismembermentByNum(ent, iArg);
03630                 }
03631         }
03632         else if (Q_stricmp(cmd, "debugDropSaber") == 0)
03633         {
03634                 if (ent->client->ps.weapon == WP_SABER &&
03635                         ent->client->ps.saberEntityNum &&
03636                         !ent->client->ps.saberInFlight)
03637                 {
03638                         saberKnockOutOfHand(&g_entities[ent->client->ps.saberEntityNum], ent, vec3_origin);
03639                 }
03640         }
03641         else if (Q_stricmp(cmd, "debugKnockMeDown") == 0)
03642         {
03643                 if (BG_KnockDownable(&ent->client->ps))
03644                 {
03645                         ent->client->ps.forceHandExtend = HANDEXTEND_KNOCKDOWN;
03646                         ent->client->ps.forceDodgeAnim = 0;
03647                         if (trap_Argc() > 1)
03648                         {
03649                                 ent->client->ps.forceHandExtendTime = level.time + 1100;
03650                                 ent->client->ps.quickerGetup = qfalse;
03651                         }
03652                         else
03653                         {
03654                                 ent->client->ps.forceHandExtendTime = level.time + 700;
03655                                 ent->client->ps.quickerGetup = qtrue;
03656                         }
03657                 }
03658         }
03659         else if (Q_stricmp(cmd, "debugSaberSwitch") == 0)
03660         {
03661                 gentity_t *targ = NULL;
03662 
03663                 if (trap_Argc() > 1)
03664                 {
03665                         char    arg[MAX_STRING_CHARS];
03666 
03667                         trap_Argv( 1, arg, sizeof( arg ) );
03668 
03669                         if (arg[0])
03670                         {
03671                                 int x = atoi(arg);
03672                                 
03673                                 if (x >= 0 && x < MAX_CLIENTS)
03674                                 {
03675                                         targ = &g_entities[x];
03676                                 }
03677                         }
03678                 }
03679 
03680                 if (targ && targ->inuse && targ->client)
03681                 {
03682                         Cmd_ToggleSaber_f(targ);
03683                 }
03684         }
03685         else if (Q_stricmp(cmd, "debugIKGrab") == 0)
03686         {
03687                 gentity_t *targ = NULL;
03688 
03689                 if (trap_Argc() > 1)
03690                 {
03691                         char    arg[MAX_STRING_CHARS];
03692 
03693                         trap_Argv( 1, arg, sizeof( arg ) );
03694 
03695                         if (arg[0])
03696                         {
03697                                 int x = atoi(arg);
03698                                 
03699                                 if (x >= 0 && x < MAX_CLIENTS)
03700                                 {
03701                                         targ = &g_entities[x];
03702                                 }
03703                         }
03704                 }
03705 
03706                 if (targ && targ->inuse && targ->client && ent->s.number != targ->s.number)
03707                 {
03708                         targ->client->ps.heldByClient = ent->s.number+1;
03709                 }
03710         }
03711         else if (Q_stricmp(cmd, "debugIKBeGrabbedBy") == 0)
03712         {
03713                 gentity_t *targ = NULL;
03714 
03715                 if (trap_Argc() > 1)
03716                 {
03717                         char    arg[MAX_STRING_CHARS];
03718 
03719                         trap_Argv( 1, arg, sizeof( arg ) );
03720 
03721                         if (arg[0])
03722                         {
03723                                 int x = atoi(arg);
03724                                 
03725                                 if (x >= 0 && x < MAX_CLIENTS)
03726                                 {
03727                                         targ = &g_entities[x];
03728                                 }
03729                         }
03730                 }
03731 
03732                 if (targ && targ->inuse && targ->client && ent->s.number != targ->s.number)
03733                 {
03734                         ent->client->ps.heldByClient = targ->s.number+1;
03735                 }
03736         }
03737         else if (Q_stricmp(cmd, "debugIKRelease") == 0)
03738         {
03739                 gentity_t *targ = NULL;
03740 
03741                 if (trap_Argc() > 1)
03742                 {
03743                         char    arg[MAX_STRING_CHARS];
03744 
03745                         trap_Argv( 1, arg, sizeof( arg ) );
03746 
03747                         if (arg[0])
03748                         {
03749                                 int x = atoi(arg);
03750                                 
03751                                 if (x >= 0 && x < MAX_CLIENTS)
03752                                 {
03753                                         targ = &g_entities[x];
03754                                 }
03755                         }
03756                 }
03757 
03758                 if (targ && targ->inuse && targ->client)
03759                 {
03760                         targ->client->ps.heldByClient = 0;
03761                 }
03762         }
03763         else if (Q_stricmp(cmd, "debugThrow") == 0)
03764         {
03765                 trace_t tr;
03766                 vec3_t tTo, fwd;
03767 
03768                 if (ent->client->ps.weaponTime > 0 || ent->client->ps.forceHandExtend != HANDEXTEND_NONE ||
03769                         ent->client->ps.groundEntityNum == ENTITYNUM_NONE || ent->health < 1)
03770                 {
03771                         return;
03772                 }
03773 
03774                 AngleVectors(ent->client->ps.viewangles, fwd, 0, 0);
03775                 tTo[0] = ent->client->ps.origin[0] + fwd[0]*32;
03776                 tTo[1] = ent->client->ps.origin[1] + fwd[1]*32;
03777                 tTo[2] = ent->client->ps.origin[2] + fwd[2]*32;
03778 
03779                 trap_Trace(&tr, ent->client->ps.origin, 0, 0, tTo, ent->s.number, MASK_PLAYERSOLID);
03780 
03781                 if (tr.fraction != 1)
03782                 {
03783                         gentity_t *other = &g_entities[tr.entityNum];
03784 
03785                         if (other->inuse && other->client && other->client->ps.forceHandExtend == HANDEXTEND_NONE &&
03786                                 other->client->ps.groundEntityNum != ENTITYNUM_NONE && other->health > 0 &&
03787                                 (int)ent->client->ps.origin[2] == (int)other->client->ps.origin[2])
03788                         {
03789                                 float pDif = 40.0f;
03790                                 vec3_t entAngles, entDir;
03791                                 vec3_t otherAngles, otherDir;
03792                                 vec3_t intendedOrigin;
03793                                 vec3_t boltOrg, pBoltOrg;
03794                                 vec3_t tAngles, vDif;
03795                                 vec3_t fwd, right;
03796                                 trace_t tr;
03797                                 trace_t tr2;
03798 
03799                                 VectorSubtract( other->client->ps.origin, ent->client->ps.origin, otherDir );
03800                                 VectorCopy( ent->client->ps.viewangles, entAngles );
03801                                 entAngles[YAW] = vectoyaw( otherDir );
03802                                 SetClientViewAngle( ent, entAngles );
03803 
03804                                 ent->client->ps.forceHandExtend = HANDEXTEND_PRETHROW;
03805                                 ent->client->ps.forceHandExtendTime = level.time + 5000;
03806 
03807                                 ent->client->throwingIndex = other->s.number;
03808                                 ent->client->doingThrow = level.time + 5000;
03809                                 ent->client->beingThrown = 0;
03810 
03811                                 VectorSubtract( ent->client->ps.origin, other->client->ps.origin, entDir );
03812                                 VectorCopy( other->client->ps.viewangles, otherAngles );
03813                                 otherAngles[YAW] = vectoyaw( entDir );
03814                                 SetClientViewAngle( other, otherAngles );
03815 
03816                                 other->client->ps.forceHandExtend = HANDEXTEND_PRETHROWN;
03817                                 other->client->ps.forceHandExtendTime = level.time + 5000;
03818 
03819                                 other->client->throwingIndex = ent->s.number;
03820                                 other->client->beingThrown = level.time + 5000;
03821                                 other->client->doingThrow = 0;
03822 
03823                                 //Doing this now at a stage in the throw, isntead of initially.
03824                                 //other->client->ps.heldByClient = ent->s.number+1;
03825 
03826                                 G_EntitySound( other, CHAN_VOICE, G_SoundIndex("*pain100.wav") );
03827                                 G_EntitySound( ent, CHAN_VOICE, G_SoundIndex("*jump1.wav") );
03828                                 G_Sound(other, CHAN_AUTO, G_SoundIndex( "sound/movers/objects/objectHit.wav" ));
03829 
03830                                 //see if we can move to be next to the hand.. if it's not clear, break the throw.
03831                                 VectorClear(tAngles);
03832                                 tAngles[YAW] = ent->client->ps.viewangles[YAW];
03833                                 VectorCopy(ent->client->ps.origin, pBoltOrg);
03834                                 AngleVectors(tAngles, fwd, right, 0);
03835                                 boltOrg[0] = pBoltOrg[0] + fwd[0]*8 + right[0]*pDif;
03836                                 boltOrg[1] = pBoltOrg[1] + fwd[1]*8 + right[1]*pDif;
03837                                 boltOrg[2] = pBoltOrg[2];
03838 
03839                                 VectorSubtract(boltOrg, pBoltOrg, vDif);
03840                                 VectorNormalize(vDif);
03841 
03842                                 VectorClear(other->client->ps.velocity);
03843                                 intendedOrigin[0] = pBoltOrg[0] + vDif[0]*pDif;
03844                                 intendedOrigin[1] = pBoltOrg[1] + vDif[1]*pDif;
03845                                 intendedOrigin[2] = other->client->ps.origin[2];
03846 
03847                                 trap_Trace(&tr, intendedOrigin, other->r.mins, other->r.maxs, intendedOrigin, other->s.number, other->clipmask);
03848                                 trap_Trace(&tr2, ent->client->ps.origin, ent->r.mins, ent->r.maxs, intendedOrigin, ent->s.number, CONTENTS_SOLID);
03849 
03850                                 if (tr.fraction == 1.0 && !tr.startsolid && tr2.fraction == 1.0 && !tr2.startsolid)
03851                                 {
03852                                         VectorCopy(intendedOrigin, other->client->ps.origin);
03853                                 }
03854                                 else
03855                                 { //if the guy can't be put here then it's time to break the throw off.
03856                                         vec3_t oppDir;
03857                                         int strength = 4;
03858 
03859                                         other->client->ps.heldByClient = 0;
03860                                         other->client->beingThrown = 0;
03861                                         ent->client->doingThrow = 0;
03862 
03863                                         ent->client->ps.forceHandExtend = HANDEXTEND_NONE;
03864                                         G_EntitySound( ent, CHAN_VOICE, G_SoundIndex("*pain25.wav") );
03865 
03866                                         other->client->ps.forceHandExtend = HANDEXTEND_NONE;
03867                                         VectorSubtract(other->client->ps.origin, ent->client->ps.origin, oppDir);
03868                                         VectorNormalize(oppDir);
03869                                         other->client->ps.velocity[0] = oppDir[0]*(strength*40);
03870                                         other->client->ps.velocity[1] = oppDir[1]*(strength*40);
03871                                         other->client->ps.velocity[2] = 150;
03872 
03873                                         VectorSubtract(ent->client->ps.origin, other->client->ps.origin, oppDir);
03874                                         VectorNormalize(oppDir);
03875                                         ent->client->ps.velocity[0] = oppDir[0]*(strength*40);
03876                                         ent->client->ps.velocity[1] = oppDir[1]*(strength*40);
03877                                         ent->client->ps.velocity[2] = 150;
03878                                 }
03879                         }
03880                 }
03881         }
03882 #endif
03883 #ifdef VM_MEMALLOC_DEBUG
03884         else if (Q_stricmp(cmd, "debugTestAlloc") == 0)
03885         { //rww - small routine to stress the malloc trap stuff and make sure nothing bad is happening.
03886                 char *blah;
03887                 int i = 1;
03888                 int x;
03889 
03890                 //stress it. Yes, this will take a while. If it doesn't explode miserably in the process.
03891                 while (i < 32768)
03892                 {
03893                         x = 0;
03894 
03895                         trap_TrueMalloc((void **)&blah, i);
03896                         if (!blah)
03897                         { //pointer is returned null if allocation failed
03898                                 trap_SendServerCommand( -1, va("print \"Failed to alloc at %i!\n\"", i));
03899                                 break;
03900                         }
03901                         while (x < i)
03902                         { //fill the allocated memory up to the edge
03903                                 if (x+1 == i)
03904                                 {
03905                                         blah[x] = 0;
03906                                 }
03907                                 else
03908                                 {
03909                                         blah[x] = 'A';
03910                                 }
03911                                 x++;
03912                         }
03913                         trap_TrueFree((void **)&blah);
03914                         if (blah)
03915                         { //should be nullified in the engine after being freed
03916                                 trap_SendServerCommand( -1, va("print \"Failed to free at %i!\n\"", i));
03917                                 break;
03918                         }
03919 
03920                         i++;
03921                 }
03922 
03923                 trap_SendServerCommand( -1, "print \"Finished allocation test\n\"");
03924         }
03925 #endif
03926 #ifndef FINAL_BUILD
03927         else if (Q_stricmp(cmd, "debugShipDamage") == 0)
03928         {
03929                 char    arg[MAX_STRING_CHARS];
03930                 char    arg2[MAX_STRING_CHARS];
03931                 int             shipSurf, damageLevel;
03932 
03933                 trap_Argv( 1, arg, sizeof( arg ) );
03934                 trap_Argv( 2, arg2, sizeof( arg2 ) );
03935                 shipSurf = SHIPSURF_FRONT+atoi(arg);
03936                 damageLevel = atoi(arg2);
03937 
03938                 G_SetVehDamageFlags( &g_entities[ent->s.m_iVehicleNum], shipSurf, damageLevel );
03939         }
03940 #endif
03941         else
03942         {
03943                 if (Q_stricmp(cmd, "addbot") == 0)
03944                 { //because addbot isn't a recognized command unless you're the server, but it is in the menus regardless
03945 //                      trap_SendServerCommand( clientNum, va("print \"You can only add bots as the server.\n\"" ) );
03946                         trap_SendServerCommand( clientNum, va("print \"%s.\n\"", G_GetStringEdString("MP_SVGAME", "ONLY_ADD_BOTS_AS_SERVER")));
03947                 }
03948                 else
03949                 {
03950                         trap_SendServerCommand( clientNum, va("print \"unknown cmd %s\n\"", cmd ) );
03951                 }
03952         }
03953 }

char* ClientConnect int  clientNum,
qboolean  firstTime,
qboolean  isBot
 

Definition at line 2258 of file g_client.c.

References BroadcastTeamChange(), CalculateRanks(), gentity_s::client, client, level_locals_t::clients, ClientUserinfoChanged(), CON_CONNECTING, clientPersistant_t::connected, EV_CLIENTJOIN, entityState_s::eventParm, G_BotConnect(), g_entities, G_FilterPacket(), g_gametype, G_GetStringEdString(), G_InitSessionData(), G_LogPrintf(), g_needpass, g_password, G_ReadSessionData(), G_TempEntity(), gclient_t, gentity_t, GT_POWERDUEL, GT_SIEGE, GT_TEAM, Info_ValueForKey(), vmCvar_t::integer, gentity_s::inuse, level, MAX_INFO_STRING, memset(), clientPersistant_t::netname, level_locals_t::newSession, NULL, gclient_s::pers, gentity_s::playerState, gclient_s::ps, Q_stricmp(), Q_strncpyz(), qtrue, gentity_s::r, gentity_s::s, S_COLOR_WHITE, gclient_s::sess, clientSession_t::sessionTeam, clientSession_t::siegeDesiredTeam, strcmp(), vmCvar_t::string, SVF_BOT, SVF_BROADCAST, entityShared_t::svFlags, TEAM_SPECTATOR, trap_GetUserinfo(), trap_SendServerCommand(), va(), and vec3_origin.

Referenced by vmMain().

02258                                                                          {
02259         char            *value;
02260 //      char            *areabits;
02261         gclient_t       *client;
02262         char            userinfo[MAX_INFO_STRING];
02263         gentity_t       *ent;
02264         gentity_t       *te;
02265 
02266         ent = &g_entities[ clientNum ];
02267 
02268         trap_GetUserinfo( clientNum, userinfo, sizeof( userinfo ) );
02269 
02270         // check to see if they are on the banned IP list
02271         value = Info_ValueForKey (userinfo, "ip");
02272         if ( G_FilterPacket( value ) ) {
02273                 return "Banned.";
02274         }
02275 
02276         if ( !( ent->r.svFlags & SVF_BOT ) && !isBot && g_needpass.integer ) {
02277                 // check for a password
02278                 value = Info_ValueForKey (userinfo, "password");
02279                 if ( g_password.string[0] && Q_stricmp( g_password.string, "none" ) &&
02280                         strcmp( g_password.string, value) != 0) {
02281                         static char sTemp[1024];
02282                         Q_strncpyz(sTemp, G_GetStringEdString("MP_SVGAME","INVALID_ESCAPE_TO_MAIN"), sizeof (sTemp) );
02283                         return sTemp;// return "Invalid password";
02284                 }
02285         }
02286 
02287         // they can connect
02288         ent->client = level.clients + clientNum;
02289         client = ent->client;
02290 
02291         //assign the pointer for bg entity access
02292         ent->playerState = &ent->client->ps;
02293 
02294 //      areabits = client->areabits;
02295 
02296         memset( client, 0, sizeof(*client) );
02297 
02298         client->pers.connected = CON_CONNECTING;
02299 
02300         // read or initialize the session data
02301         if ( firstTime || level.newSession ) {
02302                 G_InitSessionData( client, userinfo, isBot );
02303         }
02304         G_ReadSessionData( client );
02305 
02306         if (g_gametype.integer == GT_SIEGE &&
02307                 (firstTime || level.newSession))
02308         { //if this is the first time then auto-assign a desired siege team and show briefing for that team
02309                 client->sess.siegeDesiredTeam = 0;//PickTeam(ent->s.number);
02310                 /*
02311                 trap_SendServerCommand(ent->s.number, va("sb %i", client->sess.siegeDesiredTeam));
02312                 */
02313                 //don't just show it - they'll see it if they switch to a team on purpose.
02314         }
02315 
02316 
02317         if (g_gametype.integer == GT_SIEGE && client->sess.sessionTeam != TEAM_SPECTATOR)
02318         {
02319                 if (firstTime || level.newSession)
02320                 { //start as spec
02321                         client->sess.siegeDesiredTeam = client->sess.sessionTeam;
02322                         client->sess.sessionTeam = TEAM_SPECTATOR;
02323                 }
02324         }
02325         else if (g_gametype.integer == GT_POWERDUEL && client->sess.sessionTeam != TEAM_SPECTATOR)
02326         {
02327                 client->sess.sessionTeam = TEAM_SPECTATOR;
02328         }
02329 
02330         if( isBot ) {
02331                 ent->r.svFlags |= SVF_BOT;
02332                 ent->inuse = qtrue;
02333                 if( !G_BotConnect( clientNum, !firstTime ) ) {
02334                         return "BotConnectfailed";
02335                 }
02336         }
02337 
02338         // get and distribute relevent paramters
02339         G_LogPrintf( "ClientConnect: %i\n", clientNum );
02340         ClientUserinfoChanged( clientNum );
02341 
02342         // don't do the "xxx connected" messages if they were caried over from previous level
02343         if ( firstTime ) {
02344                 trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " %s\n\"", client->pers.netname, G_GetStringEdString("MP_SVGAME", "PLCONNECT")) );
02345         }
02346 
02347         if ( g_gametype.integer >= GT_TEAM &&
02348                 client->sess.sessionTeam != TEAM_SPECTATOR ) {
02349                 BroadcastTeamChange( client, -1 );
02350         }
02351 
02352         // count current clients and rank for scoreboard
02353         CalculateRanks();
02354 
02355         te = G_TempEntity( vec3_origin, EV_CLIENTJOIN );
02356         te->r.svFlags |= SVF_BROADCAST;
02357         te->s.eventParm = clientNum;
02358 
02359         // for statistics
02360 //      client->areabits = areabits;
02361 //      if ( !client->areabits )
02362 //              client->areabits = G_Alloc( (trap_AAS_PointReachabilityAreaIndex( NULL ) + 7) / 8 );
02363 
02364         return NULL;
02365 }

void ClientDisconnect int  clientNum  ) 
 

Definition at line 3808 of file g_client.c.

References bgEntity_t, BotAIShutdownClient(), CalculateRanks(), CHAN_VOICE, gentity_s::classname, gentity_s::client, entityState_s::clientNum, level_locals_t::clients, ClientUserinfoChanged(), CON_CONNECTED, CON_DISCONNECTED, clientPersistant_t::connected, entityShared_t::contents, CS_PLAYERS, vehicleInfo_t::Eject, EV_PLAYER_TELEPORT_OUT, playerState_s::fd, forcedata_s::forcePowersActive, G_ClearClientLog(), g_entities, g_gametype, G_LogPrintf(), G_MuteSound(), G_RemoveQueuedBotBegin(), G_TempEntity(), gentity_t, gentity_s::ghoul2, GT_DUEL, vmCvar_t::integer, level_locals_t::intermissiontime, gentity_s::inuse, forcedata_s::killSoundEntIndex, level, playerState_s::m_iVehicleNum, gentity_s::m_pVehicle, Vehicle_s::m_pVehicleInfo, MAX_GENTITIES, MAX_SABERS, level_locals_t::maxclients, entityState_s::modelindex, NUM_FORCE_POWERS, NUM_TRACK_CHANNELS, playerState_s::origin, gclient_s::pers, PERS_SCORE, PERS_TEAM, playerState_s::persistant, gclient_s::ps, qfalse, qtrue, gentity_s::r, gentity_s::s, gclient_s::sess, clientSession_t::sessionTeam, level_locals_t::sortedClients, SPECTATOR_FOLLOW, clientSession_t::spectatorClient, clientSession_t::spectatorState, StopFollowing(), SVF_BOT, entityShared_t::svFlags, TEAM_FREE, TEAM_SPECTATOR, TossClientItems(), TRACK_CHANNEL_1, trap_G2_HaveWeGhoul2Models(), trap_G2API_CleanGhoul2Models(), trap_SetConfigstring(), trap_UnlinkEntity(), level_locals_t::warmupTime, gclient_s::weaponGhoul2, and WP_ForcePowerStop().

Referenced by vmMain().

03808                                        {
03809         gentity_t       *ent;
03810         gentity_t       *tent;
03811         int                     i;
03812 
03813         // cleanup if we are kicking a bot that
03814         // hasn't spawned yet
03815         G_RemoveQueuedBotBegin( clientNum );
03816 
03817         ent = g_entities + clientNum;
03818         if ( !ent->client ) {
03819                 return;
03820         }
03821 
03822         i = 0;
03823 
03824         while (i < NUM_FORCE_POWERS)
03825         {
03826                 if (ent->client->ps.fd.forcePowersActive & (1 << i))
03827                 {
03828                         WP_ForcePowerStop(ent, i);
03829                 }
03830                 i++;
03831         }
03832 
03833         i = TRACK_CHANNEL_1;
03834 
03835         while (i < NUM_TRACK_CHANNELS)
03836         {
03837                 if (ent->client->ps.fd.killSoundEntIndex[i-50] && ent->client->ps.fd.killSoundEntIndex[i-50] < MAX_GENTITIES && ent->client->ps.fd.killSoundEntIndex[i-50] > 0)
03838                 {
03839                         G_MuteSound(ent->client->ps.fd.killSoundEntIndex[i-50], CHAN_VOICE);
03840                 }
03841                 i++;
03842         }
03843         i = 0;
03844 
03845         if (ent->client->ps.m_iVehicleNum)
03846         { //tell it I'm getting off
03847                 gentity_t *veh = &g_entities[ent->client->ps.m_iVehicleNum];
03848 
03849                 if (veh->inuse && veh->client && veh->m_pVehicle)
03850                 {
03851                         int pCon = ent->client->pers.connected;
03852 
03853                         ent->client->pers.connected = 0;
03854                         veh->m_pVehicle->m_pVehicleInfo->Eject(veh->m_pVehicle, (bgEntity_t *)ent, qtrue);
03855                         ent->client->pers.connected = pCon;
03856                 }
03857         }
03858 
03859         // stop any following clients
03860         for ( i = 0 ; i < level.maxclients ; i++ ) {
03861                 if ( level.clients[i].sess.sessionTeam == TEAM_SPECTATOR
03862                         && level.clients[i].sess.spectatorState == SPECTATOR_FOLLOW
03863                         && level.clients[i].sess.spectatorClient == clientNum ) {
03864                         StopFollowing( &g_entities[i] );
03865                 }
03866         }
03867 
03868         // send effect if they were completely connected
03869         if ( ent->client->pers.connected == CON_CONNECTED 
03870                 && ent->client->sess.sessionTeam != TEAM_SPECTATOR ) {
03871                 tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_OUT );
03872                 tent->s.clientNum = ent->s.clientNum;
03873 
03874                 // They don't get to take powerups with them!
03875                 // Especially important for stuff like CTF flags
03876                 TossClientItems( ent );
03877         }
03878 
03879         G_LogPrintf( "ClientDisconnect: %i\n", clientNum );
03880 
03881         // if we are playing in tourney mode, give a win to the other player and clear his frags for this round
03882         if ( (g_gametype.integer == GT_DUEL )
03883                 && !level.intermissiontime
03884                 && !level.warmupTime ) {
03885                 if ( level.sortedClients[1] == clientNum ) {
03886                         level.clients[ level.sortedClients[0] ].ps.persistant[PERS_SCORE] = 0;
03887                         level.clients[ level.sortedClients[0] ].sess.wins++;
03888                         ClientUserinfoChanged( level.sortedClients[0] );
03889                 }
03890                 else if ( level.sortedClients[0] == clientNum ) {
03891                         level.clients[ level.sortedClients[1] ].ps.persistant[PERS_SCORE] = 0;
03892                         level.clients[ level.sortedClients[1] ].sess.wins++;
03893                         ClientUserinfoChanged( level.sortedClients[1] );
03894                 }
03895         }
03896 
03897         if (ent->ghoul2 && trap_G2_HaveWeGhoul2Models(ent->ghoul2))
03898         {
03899                 trap_G2API_CleanGhoul2Models(&ent->ghoul2);
03900         }
03901         i = 0;
03902         while (i < MAX_SABERS)
03903         {
03904                 if (ent->client->weaponGhoul2[i] && trap_G2_HaveWeGhoul2Models(ent->client->weaponGhoul2[i]))
03905                 {
03906                         trap_G2API_CleanGhoul2Models(&ent->client->weaponGhoul2[i]);
03907                 }
03908                 i++;
03909         }
03910 
03911         trap_UnlinkEntity (ent);
03912         ent->s.modelindex = 0;
03913         ent->inuse = qfalse;
03914         ent->classname = "disconnected";
03915         ent->client->pers.connected = CON_DISCONNECTED;
03916         ent->client->ps.persistant[PERS_TEAM] = TEAM_FREE;
03917         ent->client->sess.sessionTeam = TEAM_FREE;
03918         ent->r.contents = 0;
03919 
03920         trap_SetConfigstring( CS_PLAYERS + clientNum, "");
03921 
03922         CalculateRanks();
03923 
03924         if ( ent->r.svFlags & SVF_BOT ) {
03925                 BotAIShutdownClient( clientNum, qfalse );
03926         }
03927 
03928         G_ClearClientLog(clientNum);
03929 }

void ClientEndFrame gentity_t ent  ) 
 

Definition at line 3766 of file g_active.c.

References BG_PlayerStateToEntityState(), BG_PlayerStateToEntityStateExtraPolate(), CLASS_VEHICLE, gentity_s::client, playerState_s::commandTime, EF_CONNECTION, entityState_s::eFlags, ET_NPC, entityState_s::eType, G_SetClientSound(), g_smoothClients, g_synchronousClients, gentity_t, gentity_s::health, vmCvar_t::integer, level_locals_t::intermissiontime, gclient_s::lastCmdTime, level, MAX_CLIENTS, MAX_POWERUPS, gclient_s::NPC_class, entityState_s::number, P_DamageFeedback(), P_WorldEffects(), gclient_s::pers, PM_FLOAT, PM_JETPACK, PM_NORMAL, playerState_s::pm_type, playerState_s::powerups, gclient_s::ps, qboolean, qfalse, qtrue, gentity_s::s, SendPendingPredictableEvents(), gclient_s::sess, clientSession_t::sessionTeam, SpectatorClientEndFrame(), STAT_HEALTH, playerState_s::stats, TEAM_SPECTATOR, level_locals_t::time, VectorClear, and playerState_s::viewangles.

Referenced by ClientSpawn(), and G_RunFrame().

03766                                       {
03767         int                     i;
03768         clientPersistant_t      *pers;
03769         qboolean isNPC = qfalse;
03770 
03771         if (ent->s.eType == ET_NPC)
03772         {
03773                 isNPC = qtrue;
03774         }
03775 
03776         if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) {
03777                 SpectatorClientEndFrame( ent );
03778                 return;
03779         }
03780 
03781         pers = &ent->client->pers;
03782 
03783         // turn off any expired powerups
03784         for ( i = 0 ; i < MAX_POWERUPS ; i++ ) {
03785                 if ( ent->client->ps.powerups[ i ] < level.time ) {
03786                         ent->client->ps.powerups[ i ] = 0;
03787                 }
03788         }
03789 
03790         // save network bandwidth
03791 #if 0
03792         if ( !g_synchronousClients->integer && (ent->client->ps.pm_type == PM_NORMAL || ent->client->ps.pm_type == PM_JETPACK || ent->client->ps.pm_type == PM_FLOAT) ) {
03793                 // FIXME: this must change eventually for non-sync demo recording
03794                 VectorClear( ent->client->ps.viewangles );
03795         }
03796 #endif
03797 
03798         //
03799         // If the end of unit layout is displayed, don't give
03800         // the player any normal movement attributes
03801         //
03802         if ( level.intermissiontime ) {
03803                 if ( ent->s.number < MAX_CLIENTS
03804                         || ent->client->NPC_class == CLASS_VEHICLE )
03805                 {//players and vehicles do nothing in intermissions
03806                         return;
03807                 }
03808         }
03809 
03810         // burn from lava, etc
03811         P_WorldEffects (ent);
03812 
03813         // apply all the damage taken this frame
03814         P_DamageFeedback (ent);
03815 
03816         // add the EF_CONNECTION flag if we haven't gotten commands recently
03817         if ( level.time - ent->client->lastCmdTime > 1000 ) {
03818                 ent->s.eFlags |= EF_CONNECTION;
03819         } else {
03820                 ent->s.eFlags &= ~EF_CONNECTION;
03821         }
03822 
03823         ent->client->ps.stats[STAT_HEALTH] = ent->health;       // FIXME: get rid of ent->health...
03824 
03825         G_SetClientSound (ent);
03826 
03827         // set the latest infor
03828         if (g_smoothClients.integer) {
03829                 BG_PlayerStateToEntityStateExtraPolate( &ent->client->ps, &ent->s, ent->client->ps.commandTime, qfalse );
03830                 //rww - 12-03-02 - Don't snap the origin of players! It screws prediction all up.
03831         }
03832         else {
03833                 BG_PlayerStateToEntityState( &ent->client->ps, &ent->s, qfalse );
03834         }
03835 
03836         if (isNPC)
03837         {
03838                 ent->s.eType = ET_NPC;
03839         }
03840 
03841         SendPendingPredictableEvents( &ent->client->ps );
03842 
03843         // set the bit for the reachability area the client is currently in
03844 //      i = trap_AAS_PointReachabilityAreaIndex( ent->client->ps.origin );
03845 //      ent->client->areabits[i >> 3] |= 1 << (i & 7);
03846 }

void ClientSpawn gentity_t ent  ) 
 

Definition at line 2930 of file g_client.c.

References gclient_s::accuracy_hits, gclient_s::accuracy_shots, gclient_s::airOutTime, playerState_s::ammo, AMMO_BLASTER, AMMO_POWERCELL, ammoData, weaponData_s::ammoIndex, atoi(), BG_PlayerStateToEntityState(), bgSiegeClasses, gclient_s::bodyGrabIndex, BOTH_STAND1TO2, CFL_EXTRA_AMMO, CFL_SINGLE_ROCKET, gentity_s::classname, gentity_s::client, client, ClientEndFrame(), playerState_s::clientNum, level_locals_t::clients, ClientThink(), ClientUserinfoChanged(), gentity_s::clipmask, playerState_s::cloakFuel, clientPersistant_t::cmd, playerState_s::commandTime, CON_DISCONNECTED, clientPersistant_t::connected, entityShared_t::contents, CONTENTS_BODY, CROUCH_MAXS_2, playerState_s::crouchheight, entityShared_t::currentOrigin, playerState_s::customRGBA, DEFAULT_MAXS_2, gentity_s::die, playerState_s::duelIndex, clientSession_t::duelTeam, DUELTEAM_LONE, DUELTEAM_SINGLE, EF_DOUBLE_AMMO, EF_INVULNERABLE, EF_TELEPORT_BIT, playerState_s::eFlags, gclient_s::enemyTeam, ENTITYNUM_NONE, playerState_s::eventSequence, playerState_s::fallingToDeath, playerState_s::fd, FL_NO_BOTS, FL_NO_HUMANS, gentity_s::flags, forcedata_t, forcedata_s::forceDoInit, forcedata_s::forcePowerLevel, FP_SABER_OFFENSE, g_duel_fraglimit, g_duelWeaponDisable, g_entities, g_forcePowerDisable, g_gametype, g_inactivity, G_KillBox(), g_powerDuelEndHealth, g_powerDuelStartHealth, G_SaberModelSetup(), G_SetAnim(), G_SetOrigin(), G_SetSaber(), g_spawnInvulnerability, g_trueJedi, G_UseTargets(), g_weaponDisable, gclient_t, playerState_s::genericEnemyIndex, gentity_t, entityState_s::groundEntityNum, GT_CTF, GT_CTY, GT_DUEL, GT_HOLOCRON, GT_JEDIMASTER, GT_POWERDUEL, GT_SIEGE, GT_TEAM, HasSetSaberOnly(), gentity_s::health, HL_MAX, gclient_s::inactivityTime, Info_SetValueForKey(), Info_ValueForKey(), clientPersistant_t::initialSpawn, vmCvar_t::integer, level_locals_t::intermissiontime, gentity_s::inuse, gclient_s::invulnerableTimer, playerState_s::isJediMaster, playerState_s::jetpackFuel, gclient_s::lastkilled_client, gclient_s::latched_buttons, playerState_s::legsAnim, playerState_s::legsTimer, level, clientPersistant_t::localClient, gentity_s::locationDamage, MASK_PLAYERSOLID, MAX_INFO_STRING, MAX_PERSISTANT, MAX_SABERS, level_locals_t::maxclients, clientPersistant_t::maxHealth, siegeClass_t::maxhealth, entityShared_t::maxs, memset(), gclient_s::mGameFlags, entityShared_t::mins, saberInfo_t::model, MoveClientToIntermission(), gclient_s::noCorpse, NPCTEAM_ENEMY, NPCTEAM_PLAYER, NULL, entityState_s::number, level_locals_t::numPlayingClients, playerState_s::origin, gclient_s::pers, PERS_SPAWN_COUNT, PERS_TEAM, playerState_s::persistant, playerState_s::ping, player_die(), playerMaxs, playerMins, gentity_s::playerState, gclient_s::playerTeam, playerState_s::pm_flags, playerState_s::pm_time, PMF_RESPAWNED, PMF_TIME_KNOCKBACK, playerState_s::powerups, gclient_s::ps, PSG_TEAMVOTED, PSG_VOTED, PW_NUM_POWERUPS, Q3_INFINITE, Q_stricmp(), qboolean, qfalse, qtrue, gentity_s::r, gclient_s::respawnTime, playerState_s::rocketLockIndex, playerState_s::rocketLockTime, gentity_s::s, gclient_s::saber, clientSession_t::saber2Type, forcedata_s::saberAnimLevel, forcedata_s::saberAnimLevelBase, gclient_s::saberCycleQueue, forcedata_s::saberDrawAnimLevel, playerState_s::saberEntityNum, saberInfo_t::saberFlags, playerState_s::saberHolstered, clientSession_t::saberLevel, gclient_s::saberStoredIndex, clientSession_t::saberType, SelectCTFSpawnPoint(), SelectDuelSpawnPoint(), SelectInitialSpawnPoint(), SelectSiegeSpawnPoint(), SelectSpawnPoint(), SelectSpectatorSpawnPoint(), usercmd_s::serverTime, gclient_s::sess, clientSession_t::sessionTeam, SETANIM_BOTH, SETANIM_FLAG_HOLD, SETANIM_FLAG_HOLDLESS, SETANIM_FLAG_OVERRIDE, SETANIM_TORSO, SetClientViewAngle(), SetTeam(), SFL_TWO_HANDED, gclient_s::siegeClass, SIEGETEAM_TEAM1, SS_DUAL, SS_FAST, SS_STAFF, SS_STRONG, playerState_s::standheight, STAT_ARMOR, STAT_HEALTH, STAT_HOLDABLE_ITEM, STAT_HOLDABLE_ITEMS, STAT_MAX_HEALTH, STAT_WEAPONS, playerTeamState_t::state, playerState_s::stats, SVF_BOT, entityShared_t::svFlags, gentity_s::takedamage, TEAM_ACTIVE, TEAM_BLUE, TEAM_RED, TEAM_SPECTATOR, TeamName(), entityState_s::teamowner, clientPersistant_t::teamState, level_locals_t::time, TORSO_RAISEWEAP1, playerState_s::torsoTimer, trap_Cvar_Set(), trap_GetUsercmd(), trap_GetUserinfo(), trap_ICARUS_FreeEnt(), trap_ICARUS_InitEnt(), trap_LinkEntity(), trap_SetUserinfo(), playerState_s::trueJedi, playerState_s::trueNonJedi, va(), vec3_t, VectorCopy, gentity_s::waterlevel, gentity_s::watertype, playerState_s::weapon, WEAPON_RAISING, weaponData, gclient_s::weaponGhoul2, WeaponReadyAnim, playerState_s::weaponstate, playerState_s::weaponTime, clientSession_t::wins, WP_BLASTER, WP_BOWCASTER, WP_BRYAR_PISTOL, WP_HasForcePowers(), WP_InitForcePowers(), WP_MELEE, WP_NONE, WP_NUM_WEAPONS, WP_ROCKET_LAUNCHER, WP_SABER, WP_SaberStyleValidForSaber(), WP_SpawnInitForcePowers(), and WP_UseFirstValidSaberStyle().

Referenced by ClientBegin(), G_ResetDuelists(), respawn(), and SiegeRespawn().

02930                                  {
02931         int                                     index;
02932         vec3_t                          spawn_origin, spawn_angles;
02933         gclient_t                       *client;
02934         int                                     i;
02935         clientPersistant_t      saved;
02936         clientSession_t         savedSess;
02937         int                                     persistant[MAX_PERSISTANT];
02938         gentity_t                       *spawnPoint;
02939         int                                     flags, gameFlags;
02940         int                                     savedPing;
02941         int                                     accuracy_hits, accuracy_shots;
02942         int                                     eventSequence;
02943         char                            userinfo[MAX_INFO_STRING];
02944         forcedata_t                     savedForce;
02945         int                                     saveSaberNum = ENTITYNUM_NONE;
02946         int                                     wDisable = 0;
02947         int                                     savedSiegeIndex = 0;
02948         int                                     maxHealth;
02949         saberInfo_t                     saberSaved[MAX_SABERS];
02950         int                                     l = 0;
02951         void                            *g2WeaponPtrs[MAX_SABERS];
02952         char                            *value;
02953         char                            *saber;
02954         qboolean                        changedSaber = qfalse;
02955         qboolean                        inSiegeWithClass = qfalse;
02956 
02957         index = ent - g_entities;
02958         client = ent->client;
02959 
02960         //first we want the userinfo so we can see if we should update this client's saber -rww
02961         trap_GetUserinfo( index, userinfo, sizeof(userinfo) );
02962         while (l < MAX_SABERS)
02963         {
02964                 switch (l)
02965                 {
02966                 case 0:
02967                         saber = &ent->client->sess.saberType[0];
02968                         break;
02969                 case 1:
02970                         saber = &ent->client->sess.saber2Type[0];
02971                         break;
02972                 default:
02973                         saber = NULL;
02974                         break;
02975                 }
02976 
02977                 value = Info_ValueForKey (userinfo, va("saber%i", l+1));
02978                 if (saber &&
02979                         value &&
02980                         (Q_stricmp(value, saber) || !saber[0] || !ent->client->saber[0].model[0]))
02981                 { //doesn't match up (or our session saber is BS), we want to try setting it
02982                         if (G_SetSaber(ent, l, value, qfalse))
02983                         {
02984                                 changedSaber = qtrue;
02985                         }
02986                         else if (!saber[0] || !ent->client->saber[0].model[0])
02987                         { //Well, we still want to say they changed then (it means this is siege and we have some overrides)
02988                                 changedSaber = qtrue;
02989                         }
02990                 }
02991                 l++;
02992         }
02993 
02994         if (changedSaber)
02995         { //make sure our new info is sent out to all the other clients, and give us a valid stance
02996                 ClientUserinfoChanged( ent->s.number );
02997 
02998                 //make sure the saber models are updated
02999                 G_SaberModelSetup(ent);
03000 
03001                 l = 0;
03002                 while (l < MAX_SABERS)
03003                 { //go through and make sure both sabers match the userinfo
03004                         switch (l)
03005                         {
03006                         case 0:
03007                                 saber = &ent->client->sess.saberType[0];
03008                                 break;
03009                         case 1:
03010                                 saber = &ent->client->sess.saber2Type[0];
03011                                 break;
03012                         default:
03013                                 saber = NULL;
03014                                 break;
03015                         }
03016 
03017                         value = Info_ValueForKey (userinfo, va("saber%i", l+1));
03018 
03019                         if (Q_stricmp(value, saber))
03020                         { //they don't match up, force the user info
03021                                 Info_SetValueForKey(userinfo, va("saber%i", l+1), saber);
03022                                 trap_SetUserinfo( ent->s.number, userinfo );
03023                         }
03024                         l++;
03025                 }
03026 
03027                 if (ent->client->saber[0].model[0] &&
03028                         ent->client->saber[1].model[0])
03029                 { //dual
03030                         ent->client->ps.fd.saberAnimLevelBase = ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = SS_DUAL;
03031                 }
03032                 else if ((ent->client->saber[0].saberFlags&SFL_TWO_HANDED))
03033                 { //staff
03034                         ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = SS_STAFF;
03035                 }
03036                 else
03037                 {
03038                         if (ent->client->sess.saberLevel < SS_FAST)
03039                         {
03040                                 ent->client->sess.saberLevel = SS_FAST;
03041                         }
03042                         else if (ent->client->sess.saberLevel > SS_STRONG)
03043                         {
03044                                 ent->client->sess.saberLevel = SS_STRONG;
03045                         }
03046                         ent->client->ps.fd.saberAnimLevelBase = ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = ent->client->sess.saberLevel;
03047 
03048                         if (g_gametype.integer != GT_SIEGE &&
03049                                 ent->client->ps.fd.saberAnimLevel > ent->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE])
03050                         {
03051                                 ent->client->ps.fd.saberAnimLevelBase = ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = ent->client->sess.saberLevel = ent->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE];
03052                         }
03053                 }
03054                 if ( g_gametype.integer != GT_SIEGE )
03055                 {
03056                         //let's just make sure the styles we chose are cool
03057                         if ( !WP_SaberStyleValidForSaber( &ent->client->saber[0], &ent->client->saber[1], ent->client->ps.saberHolstered, ent->client->ps.fd.saberAnimLevel ) )
03058                         {
03059                                 WP_UseFirstValidSaberStyle( &ent->client->saber[0], &ent->client->saber[1], ent->client->ps.saberHolstered, &ent->client->ps.fd.saberAnimLevel );
03060                                 ent->client->ps.fd.saberAnimLevelBase = ent->client->saberCycleQueue = ent->client->ps.fd.saberAnimLevel;
03061                         }
03062                 }
03063         }
03064         l = 0;
03065 
03066         if (client->ps.fd.forceDoInit)
03067         { //force a reread of force powers
03068                 WP_InitForcePowers( ent );
03069                 client->ps.fd.forceDoInit = 0;
03070         }
03071 
03072         if (ent->client->ps.fd.saberAnimLevel != SS_STAFF &&
03073                 ent->client->ps.fd.saberAnimLevel != SS_DUAL &&
03074                 ent->client->ps.fd.saberAnimLevel == ent->client->ps.fd.saberDrawAnimLevel &&
03075                 ent->client->ps.fd.saberAnimLevel == ent->client->sess.saberLevel)
03076         {
03077                 if (ent->client->sess.saberLevel < SS_FAST)
03078                 {
03079                         ent->client->sess.saberLevel = SS_FAST;
03080                 }
03081                 else if (ent->client->sess.saberLevel > SS_STRONG)
03082                 {
03083                         ent->client->sess.saberLevel = SS_STRONG;
03084                 }
03085                 ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = ent->client->sess.saberLevel;
03086 
03087                 if (g_gametype.integer != GT_SIEGE &&
03088                         ent->client->ps.fd.saberAnimLevel > ent->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE])
03089                 {
03090                         ent->client->ps.fd.saberAnimLevel = ent->client->ps.fd.saberDrawAnimLevel = ent->client->sess.saberLevel = ent->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE];
03091                 }
03092         }
03093 
03094         // find a spawn point
03095         // do it before setting health back up, so farthest
03096         // ranging doesn't count this client
03097         if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
03098                 spawnPoint = SelectSpectatorSpawnPoint ( 
03099                                                 spawn_origin, spawn_angles);
03100         } else if (g_gametype.integer == GT_CTF || g_gametype.integer == GT_CTY) {
03101                 // all base oriented team games use the CTF spawn points
03102                 spawnPoint = SelectCTFSpawnPoint ( 
03103                                                 client->sess.sessionTeam, 
03104                                                 client->pers.teamState.state, 
03105                                                 spawn_origin, spawn_angles);
03106         }
03107         else if (g_gametype.integer == GT_SIEGE)
03108         {
03109                 spawnPoint = SelectSiegeSpawnPoint (
03110                                                 client->siegeClass,
03111                                                 client->sess.sessionTeam, 
03112                                                 client->pers.teamState.state, 
03113                                                 spawn_origin, spawn_angles);
03114         }
03115         else {
03116                 do {
03117                         if (g_gametype.integer == GT_POWERDUEL)
03118                         {
03119                                 spawnPoint = SelectDuelSpawnPoint(client->sess.duelTeam, client->ps.origin, spawn_origin, spawn_angles);
03120                         }
03121                         else if (g_gametype.integer == GT_DUEL)
03122                         {       // duel 
03123                                 spawnPoint = SelectDuelSpawnPoint(DUELTEAM_SINGLE, client->ps.origin, spawn_origin, spawn_angles);
03124                         }
03125                         else
03126                         {
03127                                 // the first spawn should be at a good looking spot
03128                                 if ( !client->pers.initialSpawn && client->pers.localClient ) {
03129                                         client->pers.initialSpawn = qtrue;
03130                                         spawnPoint = SelectInitialSpawnPoint( spawn_origin, spawn_angles, client->sess.sessionTeam );
03131                                 } else {
03132                                         // don't spawn near existing origin if possible
03133                                         spawnPoint = SelectSpawnPoint ( 
03134                                                 client->ps.origin, 
03135                                                 spawn_origin, spawn_angles, client->sess.sessionTeam );
03136                                 }
03137                         }
03138 
03139                         // Tim needs to prevent bots from spawning at the initial point
03140                         // on q3dm0...
03141                         if ( ( spawnPoint->flags & FL_NO_BOTS ) && ( ent->r.svFlags & SVF_BOT ) ) {
03142                                 continue;       // try again
03143                         }
03144                         // just to be symetric, we have a nohumans option...
03145                         if ( ( spawnPoint->flags & FL_NO_HUMANS ) && !( ent->r.svFlags & SVF_BOT ) ) {
03146                                 continue;       // try again
03147                         }
03148 
03149                         break;
03150 
03151                 } while ( 1 );
03152         }
03153         client->pers.teamState.state = TEAM_ACTIVE;
03154 
03155         // toggle the teleport bit so the client knows to not lerp
03156         // and never clear the voted flag
03157         flags = ent->client->ps.eFlags & (EF_TELEPORT_BIT );
03158         flags ^= EF_TELEPORT_BIT;
03159         gameFlags = ent->client->mGameFlags & ( PSG_VOTED | PSG_TEAMVOTED);
03160 
03161         // clear everything but the persistant data
03162 
03163         saved = client->pers;
03164         savedSess = client->sess;
03165         savedPing = client->ps.ping;
03166 //      savedAreaBits = client->areabits;
03167         accuracy_hits = client->accuracy_hits;
03168         accuracy_shots = client->accuracy_shots;
03169         for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
03170                 persistant[i] = client->ps.persistant[i];
03171         }
03172         eventSequence = client->ps.eventSequence;
03173 
03174         savedForce = client->ps.fd;
03175 
03176         saveSaberNum = client->ps.saberEntityNum;
03177 
03178         savedSiegeIndex = client->siegeClass;
03179 
03180         l = 0;
03181         while (l < MAX_SABERS)
03182         {
03183                 saberSaved[l] = client->saber[l];
03184                 g2WeaponPtrs[l] = client->weaponGhoul2[l];
03185                 l++;
03186         }
03187 
03188         i = 0;
03189         while (i < HL_MAX)
03190         {
03191                 ent->locationDamage[i] = 0;
03192                 i++;
03193         }
03194 
03195         memset (client, 0, sizeof(*client)); // bk FIXME: Com_Memset?
03196         client->bodyGrabIndex = ENTITYNUM_NONE;
03197 
03198         //Get the skin RGB based on his userinfo
03199         value = Info_ValueForKey (userinfo, "char_color_red");
03200         if (value)
03201         {
03202                 client->ps.customRGBA[0] = atoi(value);
03203         }
03204         else
03205         {
03206                 client->ps.customRGBA[0] = 255;
03207         }
03208 
03209         value = Info_ValueForKey (userinfo, "char_color_green");
03210         if (value)
03211         {
03212                 client->ps.customRGBA[1] = atoi(value);
03213         }
03214         else
03215         {
03216                 client->ps.customRGBA[1] = 255;
03217         }
03218 
03219         value = Info_ValueForKey (userinfo, "char_color_blue");
03220         if (value)
03221         {
03222                 client->ps.customRGBA[2] = atoi(value);
03223         }
03224         else
03225         {
03226                 client->ps.customRGBA[2] = 255;
03227         }
03228 
03229         if ((client->ps.customRGBA[0]+client->ps.customRGBA[1]+client->ps.customRGBA[2]) < 100)
03230         { //hmm, too dark!
03231                 client->ps.customRGBA[0] = client->ps.customRGBA[1] = client->ps.customRGBA[2] = 255;
03232         }
03233 
03234         client->ps.customRGBA[3]=255;
03235 
03236         client->siegeClass = savedSiegeIndex;
03237 
03238         l = 0;
03239         while (l < MAX_SABERS)
03240         {
03241                 client->saber[l] = saberSaved[l];
03242                 client->weaponGhoul2[l] = g2WeaponPtrs[l];
03243                 l++;
03244         }
03245 
03246         //or the saber ent num
03247         client->ps.saberEntityNum = saveSaberNum;
03248         client->saberStoredIndex = saveSaberNum;
03249 
03250         client->ps.fd = savedForce;
03251 
03252         client->ps.duelIndex = ENTITYNUM_NONE;
03253 
03254         //spawn with 100
03255         client->ps.jetpackFuel = 100;
03256         client->ps.cloakFuel = 100;
03257 
03258         client->pers = saved;
03259         client->sess = savedSess;
03260         client->ps.ping = savedPing;
03261 //      client->areabits = savedAreaBits;
03262         client->accuracy_hits = accuracy_hits;
03263         client->accuracy_shots = accuracy_shots;
03264         client->lastkilled_client = -1;
03265 
03266         for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
03267                 client->ps.persistant[i] = persistant[i];
03268         }
03269         client->ps.eventSequence = eventSequence;
03270         // increment the spawncount so the client will detect the respawn
03271         client->ps.persistant[PERS_SPAWN_COUNT]++;
03272         client->ps.persistant[PERS_TEAM] = client->sess.sessionTeam;
03273 
03274         client->airOutTime = level.time + 12000;
03275 
03276         // set max health
03277         if (g_gametype.integer == GT_SIEGE && client->siegeClass != -1)
03278         {
03279                 siegeClass_t *scl = &bgSiegeClasses[client->siegeClass];
03280                 maxHealth = 100;
03281 
03282                 if (scl->maxhealth)
03283                 {
03284                         maxHealth = scl->maxhealth;
03285                 }
03286         }
03287         else
03288         {
03289                 maxHealth = 100;
03290         }
03291         client->pers.maxHealth = maxHealth;//atoi( Info_ValueForKey( userinfo, "handicap" ) );
03292         if ( client->pers.maxHealth < 1 || client->pers.maxHealth > maxHealth ) {
03293                 client->pers.maxHealth = 100;
03294         }
03295         // clear entity values
03296         client->ps.stats[STAT_MAX_HEALTH] = client->pers.maxHealth;
03297         client->ps.eFlags = flags;
03298         client->mGameFlags = gameFlags;
03299 
03300         ent->s.groundEntityNum = ENTITYNUM_NONE;
03301         ent->client = &level.clients[index];
03302         ent->playerState = &ent->client->ps;
03303         ent->takedamage = qtrue;
03304         ent->inuse = qtrue;
03305         ent->classname = "player";
03306         ent->r.contents = CONTENTS_BODY;
03307         ent->clipmask = MASK_PLAYERSOLID;
03308         ent->die = player_die;
03309         ent->waterlevel = 0;
03310         ent->watertype = 0;
03311         ent->flags = 0;
03312         
03313         VectorCopy (playerMins, ent->r.mins);
03314         VectorCopy (playerMaxs, ent->r.maxs);
03315         client->ps.crouchheight = CROUCH_MAXS_2;
03316         client->ps.standheight = DEFAULT_MAXS_2;
03317 
03318         client->ps.clientNum = index;
03319         //give default weapons
03320         client->ps.stats[STAT_WEAPONS] = ( 1 << WP_NONE );
03321 
03322         if (g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL)
03323         {
03324                 wDisable = g_duelWeaponDisable.integer;
03325         }
03326         else
03327         {
03328                 wDisable = g_weaponDisable.integer;
03329         }
03330 
03331 
03332 
03333         if ( g_gametype.integer != GT_HOLOCRON 
03334                 && g_gametype.integer != GT_JEDIMASTER 
03335                 && !HasSetSaberOnly()
03336                 && !AllForceDisabled( g_forcePowerDisable.integer )
03337                 && g_trueJedi.integer )
03338         {
03339                 if ( g_gametype.integer >= GT_TEAM && (client->sess.sessionTeam == TEAM_BLUE || client->sess.sessionTeam == TEAM_RED) )
03340                 {//In Team games, force one side to be merc and other to be jedi
03341                         if ( level.numPlayingClients > 0 )
03342                         {//already someone in the game
03343                                 int             i, forceTeam = TEAM_SPECTATOR;
03344                                 for ( i = 0 ; i < level.maxclients ; i++ ) 
03345                                 {
03346                                         if ( level.clients[i].pers.connected == CON_DISCONNECTED ) {
03347                                                 continue;
03348                                         }
03349                                         if ( level.clients[i].sess.sessionTeam == TEAM_BLUE || level.clients[i].sess.sessionTeam == TEAM_RED ) 
03350                                         {//in-game
03351                                                 if ( WP_HasForcePowers( &level.clients[i].ps ) )
03352                                                 {//this side is using force
03353                                                         forceTeam = level.clients[i].sess.sessionTeam;
03354                                                 }
03355                                                 else
03356                                                 {//other team is using force
03357                                                         if ( level.clients[i].sess.sessionTeam == TEAM_BLUE )
03358                                                         {
03359                                                                 forceTeam = TEAM_RED;
03360                                                         }
03361                                                         else
03362                                                         {
03363                                                                 forceTeam = TEAM_BLUE;
03364                                                         }
03365                                                 }
03366                                                 break;
03367                                         }
03368                                 }
03369                                 if ( WP_HasForcePowers( &client->ps ) && client->sess.sessionTeam != forceTeam )
03370                                 {//using force but not on right team, switch him over
03371                                         const char *teamName = TeamName( forceTeam );
03372                                         //client->sess.sessionTeam = forceTeam;
03373                                         SetTeam( ent, (char *)teamName );
03374                                         return;
03375                                 }
03376                         }
03377                 }
03378 
03379                 if ( WP_HasForcePowers( &client->ps ) )
03380                 {
03381                         client->ps.trueNonJedi = qfalse;
03382                         client->ps.trueJedi = qtrue;
03383                         //make sure they only use the saber
03384                         client->ps.weapon = WP_SABER;
03385                         client->ps.stats[STAT_WEAPONS] = (1 << WP_SABER);
03386                 }
03387                 else
03388                 {//no force powers set
03389                         client->ps.trueNonJedi = qtrue;
03390                         client->ps.trueJedi = qfalse;
03391                         if (!wDisable || !(wDisable & (1 << WP_BRYAR_PISTOL)))
03392                         {
03393                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_BRYAR_PISTOL );
03394                         }
03395                         if (!wDisable || !(wDisable & (1 << WP_BLASTER)))
03396                         {
03397                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_BLASTER );
03398                         }
03399                         if (!wDisable || !(wDisable & (1 << WP_BOWCASTER)))
03400                         {
03401                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_BOWCASTER );
03402                         }
03403                         client->ps.stats[STAT_WEAPONS] &= ~(1 << WP_SABER);
03404                         client->ps.stats[STAT_WEAPONS] |= (1 << WP_MELEE);
03405                         client->ps.ammo[AMMO_POWERCELL] = ammoData[AMMO_POWERCELL].max;
03406                         client->ps.weapon = WP_BRYAR_PISTOL;
03407                 }
03408         }
03409         else
03410         {//jediVmerc is incompatible with this gametype, turn it off!
03411                 trap_Cvar_Set( "g_jediVmerc", "0" );
03412                 if (g_gametype.integer == GT_HOLOCRON)
03413                 {
03414                         //always get free saber level 1 in holocron
03415                         client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_SABER );    //these are precached in g_items, ClearRegisteredItems()
03416                 }
03417                 else
03418                 {
03419                         if (client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE])
03420                         {
03421                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_SABER );    //these are precached in g_items, ClearRegisteredItems()
03422                         }
03423                         else
03424                         { //if you don't have saber attack rank then you don't get a saber
03425                                 client->ps.stats[STAT_WEAPONS] |= (1 << WP_MELEE);
03426                         }
03427                 }
03428 
03429                 if (g_gametype.integer != GT_SIEGE)
03430                 {
03431                         if (!wDisable || !(wDisable & (1 << WP_BRYAR_PISTOL)))
03432                         {
03433                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_BRYAR_PISTOL );
03434                         }
03435                         else if (g_gametype.integer == GT_JEDIMASTER)
03436                         {
03437                                 client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_BRYAR_PISTOL );
03438                         }
03439                 }
03440 
03441                 if (g_gametype.integer == GT_JEDIMASTER)
03442                 {
03443                         client->ps.stats[STAT_WEAPONS] &= ~(1 << WP_SABER);
03444                         client->ps.stats[STAT_WEAPONS] |= (1 << WP_MELEE);
03445                 }
03446 
03447                 if (client->ps.stats[STAT_WEAPONS] & (1 << WP_SABER))
03448                 {
03449                         client->ps.weapon = WP_SABER;
03450                 }
03451                 else if (client->ps.stats[STAT_WEAPONS] & (1 << WP_BRYAR_PISTOL))
03452                 {
03453                         client->ps.weapon = WP_BRYAR_PISTOL;
03454                 }
03455                 else
03456                 {
03457                         client->ps.weapon = WP_MELEE;
03458                 }
03459         }
03460 
03461         /*
03462         client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_BINOCULARS );
03463         client->ps.stats[STAT_HOLDABLE_ITEM] = BG_GetItemIndexByTag(HI_BINOCULARS, IT_HOLDABLE);
03464         */
03465 
03466         if (g_gametype.integer == GT_SIEGE && client->siegeClass != -1 &&
03467                 client->sess.sessionTeam != TEAM_SPECTATOR)
03468         { //well then, we will use a custom weaponset for our class
03469                 int m = 0;
03470 
03471                 client->ps.stats[STAT_WEAPONS] = bgSiegeClasses[client->siegeClass].weapons;
03472 
03473                 if (client->ps.stats[STAT_WEAPONS] & (1 << WP_SABER))
03474                 {
03475                         client->ps.weapon = WP_SABER;
03476                 }
03477                 else if (client->ps.stats[STAT_WEAPONS] & (1 << WP_BRYAR_PISTOL))
03478                 {
03479                         client->ps.weapon = WP_BRYAR_PISTOL;
03480                 }
03481                 else
03482                 {
03483                         client->ps.weapon = WP_MELEE;
03484                 }
03485                 inSiegeWithClass = qtrue;
03486 
03487                 while (m < WP_NUM_WEAPONS)
03488                 {
03489                         if (client->ps.stats[STAT_WEAPONS] & (1 << m))
03490                         {
03491                                 if (client->ps.weapon != WP_SABER)
03492                                 { //try to find the highest ranking weapon we have
03493                                         if (m > client->ps.weapon)
03494                                         {
03495                                                 client->ps.weapon = m;
03496                                         }
03497                                 }
03498 
03499                                 if (m >= WP_BRYAR_PISTOL)
03500                                 { //Max his ammo out for all the weapons he has.
03501                                         if ( g_gametype.integer == GT_SIEGE 
03502                                                 && m == WP_ROCKET_LAUNCHER )
03503                                         {//don't give full ammo!
03504                                                 //FIXME: extern this and check it when getting ammo from supplier, pickups or ammo stations!
03505                                                 if ( client->siegeClass != -1 &&
03506                                                         (bgSiegeClasses[client->siegeClass].classflags & (1<<CFL_SINGLE_ROCKET)) )
03507                                                 {
03508                                                         client->ps.ammo[weaponData[m].ammoIndex] = 1;
03509                                                 }
03510                                                 else
03511                                                 {
03512                                                         client->ps.ammo[weaponData[m].ammoIndex] = 10;
03513                                                 }
03514                                         }
03515                                         else
03516                                         {
03517                                                 if ( g_gametype.integer == GT_SIEGE 
03518                                                         && client->siegeClass != -1
03519                                                         && (bgSiegeClasses[client->siegeClass].classflags & (1<<CFL_EXTRA_AMMO)) )
03520                                                 {//double ammo
03521                                                         client->ps.ammo[weaponData[m].ammoIndex] = ammoData[weaponData[m].ammoIndex].max*2;
03522                                                         client->ps.eFlags |= EF_DOUBLE_AMMO;
03523                                                 }
03524                                                 else
03525                                                 {
03526                                                         client->ps.ammo[weaponData[m].ammoIndex] = ammoData[weaponData[m].ammoIndex].max;
03527                                                 }
03528                                         }
03529                                 }
03530                         }
03531                         m++;
03532                 }
03533         }
03534 
03535         if (g_gametype.integer == GT_SIEGE &&
03536                 client->siegeClass != -1 &&
03537                 client->sess.sessionTeam != TEAM_SPECTATOR)
03538         { //use class-specified inventory
03539                 client->ps.stats[STAT_HOLDABLE_ITEMS] = bgSiegeClasses[client->siegeClass].invenItems;
03540                 client->ps.stats[STAT_HOLDABLE_ITEM] = 0;
03541         }
03542         else
03543         {
03544                 client->ps.stats[STAT_HOLDABLE_ITEMS] = 0;
03545                 client->ps.stats[STAT_HOLDABLE_ITEM] = 0;
03546         }
03547 
03548         if (g_gametype.integer == GT_SIEGE &&
03549                 client->siegeClass != -1 &&
03550                 bgSiegeClasses[client->siegeClass].powerups &&
03551                 client->sess.sessionTeam != TEAM_SPECTATOR)
03552         { //this class has some start powerups
03553                 i = 0;
03554                 while (i < PW_NUM_POWERUPS)
03555                 {
03556                         if (bgSiegeClasses[client->siegeClass].powerups & (1 << i))
03557                         {
03558                                 client->ps.powerups[i] = Q3_INFINITE;
03559                         }
03560                         i++;
03561                 }
03562         }
03563 
03564         if ( client->sess.sessionTeam == TEAM_SPECTATOR )
03565         {
03566                 client->ps.stats[STAT_WEAPONS] = 0;
03567                 client->ps.stats[STAT_HOLDABLE_ITEMS] = 0;
03568                 client->ps.stats[STAT_HOLDABLE_ITEM] = 0;
03569         }
03570 
03571 // nmckenzie: DESERT_SIEGE... or well, siege generally.  This was over-writing the max value, which was NOT good for siege.
03572         if ( inSiegeWithClass == qfalse )
03573         {
03574                 client->ps.ammo[AMMO_BLASTER] = 100; //ammoData[AMMO_BLASTER].max; //100 seems fair.
03575         }
03576 //      client->ps.ammo[AMMO_POWERCELL] = ammoData[AMMO_POWERCELL].max;
03577 //      client->ps.ammo[AMMO_FORCE] = ammoData[AMMO_FORCE].max;
03578 //      client->ps.ammo[AMMO_METAL_BOLTS] = ammoData[AMMO_METAL_BOLTS].max;
03579 //      client->ps.ammo[AMMO_ROCKETS] = ammoData[AMMO_ROCKETS].max;
03580 /*
03581         client->ps.stats[STAT_WEAPONS] = ( 1 << WP_BRYAR_PISTOL);
03582         if ( g_gametype.integer == GT_TEAM ) {
03583                 client->ps.ammo[WP_BRYAR_PISTOL] = 50;
03584         } else {
03585                 client->ps.ammo[WP_BRYAR_PISTOL] = 100;
03586         }
03587 */
03588         client->ps.rocketLockIndex = ENTITYNUM_NONE;
03589         client->ps.rocketLockTime = 0;
03590 
03591         //rww - Set here to initialize the circling seeker drone to off.
03592         //A quick note about this so I don't forget how it works again:
03593         //ps.genericEnemyIndex is kept in sync between the server and client.
03594         //When it gets set then an entitystate value of the same name gets
03595         //set along with an entitystate flag in the shared bg code. Which
03596         //is why a value needs to be both on the player state and entity state.
03597         //(it doesn't seem to just carry over the entitystate value automatically
03598         //because entity state value is derived from player state data or some
03599         //such)
03600         client->ps.genericEnemyIndex = -1;
03601 
03602         client->ps.isJediMaster = qfalse;
03603 
03604         if (client->ps.fallingToDeath)
03605         {
03606                 client->ps.fallingToDeath = 0;
03607                 client->noCorpse = qtrue;
03608         }
03609 
03610         //Do per-spawn force power initialization
03611         WP_SpawnInitForcePowers( ent );
03612 
03613         // health will count down towards max_health
03614         if (g_gametype.integer == GT_SIEGE &&
03615                 client->siegeClass != -1 &&
03616                 bgSiegeClasses[client->siegeClass].starthealth)
03617         { //class specifies a start health, so use it
03618                 ent->health = client->ps.stats[STAT_HEALTH] = bgSiegeClasses[client->siegeClass].starthealth;
03619         }
03620         else if ( g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL )
03621         {//only start with 100 health in Duel
03622                 if ( g_gametype.integer == GT_POWERDUEL && client->sess.duelTeam == DUELTEAM_LONE )
03623                 {
03624                         if ( g_duel_fraglimit.integer )
03625                         {
03626                                 
03627                                 ent->health = client->ps.stats[STAT_HEALTH] = client->ps.stats[STAT_MAX_HEALTH] =
03628                                         g_powerDuelStartHealth.integer - ((g_powerDuelStartHealth.integer - g_powerDuelEndHealth.integer) * (float)client->sess.wins / (float)g_duel_fraglimit.integer);
03629                         }
03630                         else
03631                         {
03632                                 ent->health = client->ps.stats[STAT_HEALTH] = client->ps.stats[STAT_MAX_HEALTH] = 150;
03633                         }
03634                 }
03635                 else
03636                 {
03637                         ent->health = client->ps.stats[STAT_HEALTH] = client->ps.stats[STAT_MAX_HEALTH] = 100;
03638                 }
03639         }
03640         else if (client->ps.stats[STAT_MAX_HEALTH] <= 100)
03641         {
03642                 ent->health = client->ps.stats[STAT_HEALTH] = client->ps.stats[STAT_MAX_HEALTH] * 1.25;
03643         }
03644         else if (client->ps.stats[STAT_MAX_HEALTH] < 125)
03645         {
03646                 ent->health = client->ps.stats[STAT_HEALTH] = 125;
03647         }
03648         else
03649         {
03650                 ent->health = client->ps.stats[STAT_HEALTH] = client->ps.stats[STAT_MAX_HEALTH];
03651         }
03652 
03653         // Start with a small amount of armor as well.
03654         if (g_gametype.integer == GT_SIEGE &&
03655                 client->siegeClass != -1 /*&&
03656                 bgSiegeClasses[client->siegeClass].startarmor*/)
03657         { //class specifies a start armor amount, so use it
03658                 client->ps.stats[STAT_ARMOR] = bgSiegeClasses[client->siegeClass].startarmor;
03659         }
03660         else if ( g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL )
03661         {//no armor in duel
03662                 client->ps.stats[STAT_ARMOR] = 0;
03663         }
03664         else
03665         {
03666                 client->ps.stats[STAT_ARMOR] = client->ps.stats[STAT_MAX_HEALTH] * 0.25;
03667         }
03668 
03669         G_SetOrigin( ent, spawn_origin );
03670         VectorCopy( spawn_origin, client->ps.origin );
03671 
03672         // the respawned flag will be cleared after the attack and jump keys come up
03673         client->ps.pm_flags |= PMF_RESPAWNED;
03674 
03675         trap_GetUsercmd( client - level.clients, &ent->client->pers.cmd );
03676         SetClientViewAngle( ent, spawn_angles );
03677 
03678         if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) {
03679 
03680         } else {
03681                 G_KillBox( ent );
03682                 trap_LinkEntity (ent);
03683 
03684                 // force the base weapon up
03685                 //client->ps.weapon = WP_BRYAR_PISTOL;
03686                 //client->ps.weaponstate = FIRST_WEAPON;
03687                 if (client->ps.weapon <= WP_NONE)
03688                 {
03689                         client->ps.weapon = WP_BRYAR_PISTOL;
03690                 }
03691 
03692                 client->ps.torsoTimer = client->ps.legsTimer = 0;
03693 
03694                 if (client->ps.weapon == WP_SABER)
03695                 {
03696                         G_SetAnim(ent, NULL, SETANIM_BOTH, BOTH_STAND1TO2, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS, 0);
03697                 }
03698                 else
03699                 {
03700                         G_SetAnim(ent, NULL, SETANIM_TORSO, TORSO_RAISEWEAP1, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_HOLDLESS, 0);
03701                         client->ps.legsAnim = WeaponReadyAnim[client->ps.weapon];
03702                 }
03703                 client->ps.weaponstate = WEAPON_RAISING;
03704                 client->ps.weaponTime = client->ps.torsoTimer;
03705         }
03706 
03707         // don't allow full run speed for a bit
03708         client->ps.pm_flags |= PMF_TIME_KNOCKBACK;
03709         client->ps.pm_time = 100;
03710 
03711         client->respawnTime = level.time;
03712         client->inactivityTime = level.time + g_inactivity.integer * 1000;
03713         client->latched_buttons = 0;
03714 
03715         if ( level.intermissiontime ) {
03716                 MoveClientToIntermission( ent );
03717         } else {
03718                 // fire the targets of the spawn point
03719                 G_UseTargets( spawnPoint, ent );
03720 
03721                 // select the highest weapon number available, after any
03722                 // spawn given items have fired
03723                 /*
03724                 client->ps.weapon = 1;
03725                 for ( i = WP_NUM_WEAPONS - 1 ; i > 0 ; i-- ) {
03726                         if ( client->ps.stats[STAT_WEAPONS] & ( 1 << i ) ) {
03727                                 client->ps.weapon = i;
03728                                 break;
03729                         }
03730                 }
03731                 */
03732         }
03733 
03734         //set teams for NPCs to recognize
03735         if (g_gametype.integer == GT_SIEGE)
03736         { //Imperial (team1) team is allied with "enemy" NPCs in this mode
03737                 if (client->sess.sessionTeam == SIEGETEAM_TEAM1)
03738                 {
03739                         client->playerTeam = ent->s.teamowner = NPCTEAM_ENEMY;
03740                         client->enemyTeam = NPCTEAM_PLAYER;
03741                 }
03742                 else
03743                 {
03744                         client->playerTeam = ent->s.teamowner = NPCTEAM_PLAYER;
03745                         client->enemyTeam = NPCTEAM_ENEMY;
03746                 }
03747         }
03748         else
03749         {
03750                 client->playerTeam = ent->s.teamowner = NPCTEAM_PLAYER;
03751                 client->enemyTeam = NPCTEAM_ENEMY;
03752         }
03753 
03754         /*
03755         //scaling for the power duel opponent
03756         if (g_gametype.integer == GT_POWERDUEL &&
03757                 client->sess.duelTeam == DUELTEAM_LONE)
03758         {
03759                 client->ps.iModelScale = 125;
03760                 VectorSet(ent->modelScale, 1.25f, 1.25f, 1.25f);
03761         }
03762         */
03763         //Disabled. At least for now. Not sure if I'll want to do it or not eventually.
03764 
03765         // run a client frame to drop exactly to the floor,
03766         // initialize animations and other things
03767         client->ps.commandTime = level.time - 100;
03768         ent->client->pers.cmd.serverTime = level.time;
03769         ClientThink( ent-g_entities, NULL );
03770 
03771         // positively link the client, even if the command times are weird
03772         if ( ent->client->sess.sessionTeam != TEAM_SPECTATOR ) {
03773                 BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue );
03774                 VectorCopy( ent->client->ps.origin, ent->r.currentOrigin );
03775                 trap_LinkEntity( ent );
03776         }
03777 
03778         if (g_spawnInvulnerability.integer)
03779         {
03780                 ent->client->ps.eFlags |= EF_INVULNERABLE;
03781                 ent->client->invulnerableTimer = level.time + g_spawnInvulnerability.integer;
03782         }
03783 
03784         // run the presend to set anything else
03785         ClientEndFrame( ent );
03786 
03787         // clear entity state values
03788         BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue );
03789 
03790         //rww - make sure client has a valid icarus instance
03791         trap_ICARUS_FreeEnt( ent );
03792         trap_ICARUS_InitEnt( ent );
03793 }

void ClientThink int  clientNum,
usercmd_t ucmd
 

Definition at line 3621 of file g_active.c.

References gentity_s::client, ClientThink_real(), clientPersistant_t::cmd, g_entities, g_synchronousClients, gentity_t, vmCvar_t::integer, gclient_s::lastCmdTime, level, MAX_CLIENTS, gclient_s::pers, gentity_s::r, SVF_BOT, entityShared_t::svFlags, level_locals_t::time, trap_GetUsercmd(), ucmd, and usercmd_t.

Referenced by ClientSpawn(), ClientThink_real(), CorpsePhysics(), NPC_Begin(), NPC_ExecuteBState(), NPC_Think(), and vmMain().

03621                                                   {
03622         gentity_t *ent;
03623 
03624         ent = g_entities + clientNum;
03625         if (clientNum < MAX_CLIENTS)
03626         {
03627                 trap_GetUsercmd( clientNum, &ent->client->pers.cmd );
03628         }
03629 
03630         // mark the time we got info, so we can display the
03631         // phone jack if they don't get any for a while
03632         ent->client->lastCmdTime = level.time;
03633 
03634         if (ucmd)
03635         {
03636                 ent->client->pers.cmd = *ucmd;
03637         }
03638 
03639 /*      This was moved to clientthink_real, but since its sort of a risky change i left it here for 
03640     now as a more concrete reference - BSD
03641   
03642         if ( clientNum < MAX_CLIENTS
03643                 && ent->client->ps.m_iVehicleNum )
03644         {//driving a vehicle
03645                 if (g_entities[ent->client->ps.m_iVehicleNum].client)
03646                 {
03647                         gentity_t *veh = &g_entities[ent->client->ps.m_iVehicleNum];
03648 
03649                         if (veh->m_pVehicle &&
03650                                 veh->m_pVehicle->m_pPilot == (bgEntity_t *)ent)
03651                         { //only take input from the pilot...
03652                                 veh->client->ps.commandTime = ent->client->ps.commandTime;
03653                                 memcpy(&veh->m_pVehicle->m_ucmd, &ent->client->pers.cmd, sizeof(usercmd_t));
03654                                 if ( veh->m_pVehicle->m_ucmd.buttons & BUTTON_TALK )
03655                                 { //forced input if "chat bubble" is up
03656                                         veh->m_pVehicle->m_ucmd.buttons = BUTTON_TALK;
03657                                         veh->m_pVehicle->m_ucmd.forwardmove = 0;
03658                                         veh->m_pVehicle->m_ucmd.rightmove = 0;
03659                                         veh->m_pVehicle->m_ucmd.upmove = 0;
03660                                 }
03661                         }
03662                 }
03663         }
03664 */
03665         if ( !(ent->r.svFlags & SVF_BOT) && !g_synchronousClients.integer ) {
03666                 ClientThink_real( ent );
03667         }
03668         // vehicles are clients and when running synchronous they still need to think here
03669         // so special case them.
03670         else if ( clientNum >= MAX_CLIENTS ) {
03671                 ClientThink_real( ent );
03672         }
03673 
03674 /*      This was moved to clientthink_real, but since its sort of a risky change i left it here for 
03675     now as a more concrete reference - BSD
03676     
03677         if ( clientNum < MAX_CLIENTS
03678                 && ent->client->ps.m_iVehicleNum )
03679         {//driving a vehicle
03680                 //run it
03681                 if (g_entities[ent->client->ps.m_iVehicleNum].inuse &&
03682                         g_entities[ent->client->ps.m_iVehicleNum].client)
03683                 {
03684                         ClientThink(ent->client->ps.m_iVehicleNum, &g_entities[ent->client->ps.m_iVehicleNum].m_pVehicle->m_ucmd);
03685                 }
03686                 else
03687                 { //vehicle no longer valid?
03688                         ent->client->ps.m_iVehicleNum = 0;
03689                 }
03690         }
03691 */
03692 }

void ClientUserinfoChanged int  clientNum  ) 
 

Definition at line 1888 of file g_client.c.

01888                                             {
01889         gentity_t *ent;
01890         int             teamTask, teamLeader, team, health;
01891         char    *s;
01892         char    model[MAX_QPATH];
01893         //char  headModel[MAX_QPATH];
01894         char    forcePowers[MAX_QPATH];
01895         char    oldname[MAX_STRING_CHARS];
01896         gclient_t       *client;
01897         char    c1[MAX_INFO_STRING];
01898         char    c2[MAX_INFO_STRING];
01899 //      char    redTeam[MAX_INFO_STRING];
01900 //      char    blueTeam[MAX_INFO_STRING];
01901         char    userinfo[MAX_INFO_STRING];
01902         char    className[MAX_QPATH]; //name of class type to use in siege
01903         char    saberName[MAX_QPATH];
01904         char    saber2Name[MAX_QPATH];
01905         char    *value;
01906         int             maxHealth;
01907         qboolean        modelChanged = qfalse;
01908 
01909         ent = g_entities + clientNum;
01910         client = ent->client;
01911 
01912         trap_GetUserinfo( clientNum, userinfo, sizeof( userinfo ) );
01913 
01914         // check for malformed or illegal info strings
01915         if ( !Info_Validate(userinfo) ) {
01916                 strcpy (userinfo, "\\name\\badinfo");
01917         }
01918 
01919         // check for local client
01920         s = Info_ValueForKey( userinfo, "ip" );
01921         if ( !strcmp( s, "localhost" ) ) {
01922                 client->pers.localClient = qtrue;
01923         }
01924 
01925         // check the item prediction
01926         s = Info_ValueForKey( userinfo, "cg_predictItems" );
01927         if ( !atoi( s ) ) {
01928                 client->pers.predictItemPickup = qfalse;
01929         } else {
01930                 client->pers.predictItemPickup = qtrue;
01931         }
01932 
01933         // set name
01934         Q_strncpyz ( oldname, client->pers.netname, sizeof( oldname ) );
01935         s = Info_ValueForKey (userinfo, "name");
01936         ClientCleanName( s, client->pers.netname, sizeof(client->pers.netname) );
01937 
01938         if ( client->sess.sessionTeam == TEAM_SPECTATOR ) {
01939                 if ( client->sess.spectatorState == SPECTATOR_SCOREBOARD ) {
01940                         Q_strncpyz( client->pers.netname, "scoreboard", sizeof(client->pers.netname) );
01941                 }
01942         }
01943 
01944         if ( client->pers.connected == CON_CONNECTED ) {
01945                 if ( strcmp( oldname, client->pers.netname ) ) 
01946                 {
01947                         if ( client->pers.netnameTime > level.time  )
01948                         {
01949                                 trap_SendServerCommand( clientNum, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "NONAMECHANGE")) );
01950 
01951                                 Info_SetValueForKey( userinfo, "name", oldname );
01952                                 trap_SetUserinfo( clientNum, userinfo );                        
01953                                 strcpy ( client->pers.netname, oldname );
01954                         }
01955                         else
01956                         {                               
01957                                 trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " %s %s\n\"", oldname, G_GetStringEdString("MP_SVGAME", "PLRENAME"), client->pers.netname) );
01958                                 client->pers.netnameTime = level.time + 5000;
01959                         }
01960                 }
01961         }
01962 
01963         // set model
01964         Q_strncpyz( model, Info_ValueForKey (userinfo, "model"), sizeof( model ) );
01965 
01966         if (d_perPlayerGhoul2.integer)
01967         {
01968                 if (Q_stricmp(model, client->modelname))
01969                 {
01970                         strcpy(client->modelname, model);
01971                         modelChanged = qtrue;
01972                 }
01973         }
01974 
01975         //Get the skin RGB based on his userinfo
01976         value = Info_ValueForKey (userinfo, "char_color_red");
01977         if (value)
01978         {
01979                 client->ps.customRGBA[0] = atoi(value);
01980         }
01981         else
01982         {
01983                 client->ps.customRGBA[0] = 255;
01984         }
01985 
01986         value = Info_ValueForKey (userinfo, "char_color_green");
01987         if (value)
01988         {
01989                 client->ps.customRGBA[1] = atoi(value);
01990         }
01991         else
01992         {
01993                 client->ps.customRGBA[1] = 255;
01994         }
01995 
01996         value = Info_ValueForKey (userinfo, "char_color_blue");
01997         if (value)
01998         {
01999                 client->ps.customRGBA[2] = atoi(value);
02000         }
02001         else
02002         {
02003                 client->ps.customRGBA[2] = 255;
02004         }
02005 
02006         if ((client->ps.customRGBA[0]+client->ps.customRGBA[1]+client->ps.customRGBA[2]) < 100)
02007         { //hmm, too dark!
02008                 client->ps.customRGBA[0] = client->ps.customRGBA[1] = client->ps.customRGBA[2] = 255;
02009         }
02010 
02011         client->ps.customRGBA[3]=255;
02012 
02013         Q_strncpyz( forcePowers, Info_ValueForKey (userinfo, "forcepowers"), sizeof( forcePowers ) );
02014 
02015         // bots set their team a few frames later
02016         if (g_gametype.integer >= GT_TEAM && g_entities[clientNum].r.svFlags & SVF_BOT) {
02017                 s = Info_ValueForKey( userinfo, "team" );
02018                 if ( !Q_stricmp( s, "red" ) || !Q_stricmp( s, "r" ) ) {
02019                         team = TEAM_RED;
02020                 } else if ( !Q_stricmp( s, "blue" ) || !Q_stricmp( s, "b" ) ) {
02021                         team = TEAM_BLUE;
02022                 } else {
02023                         // pick the team with the least number of players
02024                         team = PickTeam( clientNum );
02025                 }
02026         }
02027         else {
02028                 team = client->sess.sessionTeam;
02029         }
02030 
02031         //Set the siege class
02032         if (g_gametype.integer == GT_SIEGE)
02033         {
02034                 strcpy(className, client->sess.siegeClass);
02035 
02036                 //This function will see if the given class is legal for the given team.
02037                 //If not className will be filled in with the first legal class for this team.
02038 /*              if (!BG_SiegeCheckClassLegality(team, className) &&
02039                         Q_stricmp(client->sess.siegeClass, "none"))
02040                 { //if it isn't legal pop up the class menu
02041                         trap_SendServerCommand(ent-g_entities, "scl");
02042                 }
02043 */
02044                 //Now that the team is legal for sure, we'll go ahead and get an index for it.
02045                 client->siegeClass = BG_SiegeFindClassIndexByName(className);
02046                 if (client->siegeClass == -1)
02047                 { //ok, get the first valid class for the team you're on then, I guess.
02048                         BG_SiegeCheckClassLegality(team, className);
02049                         strcpy(client->sess.siegeClass, className);
02050                         client->siegeClass = BG_SiegeFindClassIndexByName(className);
02051                 }
02052                 else
02053                 { //otherwise, make sure the class we are using is legal.
02054                         G_ValidateSiegeClassForTeam(ent, team);
02055                         strcpy(className, client->sess.siegeClass);
02056                 }
02057 
02058                 //Set the sabers if the class dictates
02059                 if (client->siegeClass != -1)
02060                 {
02061                         siegeClass_t *scl = &bgSiegeClasses[client->siegeClass];
02062 
02063                         if (scl->saber1[0])
02064                         {
02065                                 G_SetSaber(ent, 0, scl->saber1, qtrue);
02066                         }
02067                         else
02068                         { //default I guess
02069                                 G_SetSaber(ent, 0, "Kyle", qtrue);
02070                         }
02071                         if (scl->saber2[0])
02072                         {
02073                                 G_SetSaber(ent, 1, scl->saber2, qtrue);
02074                         }
02075                         else
02076                         { //no second saber then
02077                                 G_SetSaber(ent, 1, "none", qtrue);
02078                         }
02079 
02080                         //make sure the saber models are updated
02081                         G_SaberModelSetup(ent);
02082 
02083                         if (scl->forcedModel[0])
02084                         { //be sure to override the model we actually use
02085                                 strcpy(model, scl->forcedModel);
02086                                 if (d_perPlayerGhoul2.integer)
02087                                 {
02088                                         if (Q_stricmp(model, client->modelname))
02089                                         {
02090                                                 strcpy(client->modelname, model);
02091                                                 modelChanged = qtrue;
02092                                         }
02093                                 }
02094                         }
02095 
02096                         //force them to use their class model on the server, if the class dictates
02097                         if (G_PlayerHasCustomSkeleton(ent))
02098                         {
02099                                 if (Q_stricmp(model, client->modelname) || ent->localAnimIndex == 0)
02100                                 {
02101                                         strcpy(client->modelname, model);
02102                                         modelChanged = qtrue;
02103                                 }
02104                         }
02105                 }
02106         }
02107         else
02108         {
02109                 strcpy(className, "none");
02110         }
02111 
02112         //Set the saber name
02113         strcpy(saberName, client->sess.saberType);
02114         strcpy(saber2Name, client->sess.saber2Type);
02115 
02116         // set max health
02117         if (g_gametype.integer == GT_SIEGE && client->siegeClass != -1)
02118         {
02119                 siegeClass_t *scl = &bgSiegeClasses[client->siegeClass];
02120                 maxHealth = 100;
02121 
02122                 if (scl->maxhealth)
02123                 {
02124                         maxHealth = scl->maxhealth;
02125                 }
02126 
02127                 health = maxHealth;
02128         }
02129         else
02130         {
02131                 maxHealth = 100;
02132                 health = 100; //atoi( Info_ValueForKey( userinfo, "handicap" ) );
02133         }
02134         client->pers.maxHealth = health;
02135         if ( client->pers.maxHealth < 1 || client->pers.maxHealth > maxHealth ) {
02136                 client->pers.maxHealth = 100;
02137         }
02138         client->ps.stats[STAT_MAX_HEALTH] = client->pers.maxHealth;
02139 
02140 /*      NOTE: all client side now
02141 
02142         // team
02143         switch( team ) {
02144         case TEAM_RED:
02145                 ForceClientSkin(client, model, "red");
02146 //              ForceClientSkin(client, headModel, "red");
02147                 break;
02148         case TEAM_BLUE:
02149                 ForceClientSkin(client, model, "blue");
02150 //              ForceClientSkin(client, headModel, "blue");
02151                 break;
02152         }
02153         // don't ever use a default skin in teamplay, it would just waste memory
02154         // however bots will always join a team but they spawn in as spectator
02155         if ( g_gametype.integer >= GT_TEAM && team == TEAM_SPECTATOR) {
02156                 ForceClientSkin(client, model, "red");
02157 //              ForceClientSkin(client, headModel, "red");
02158         }
02159 */
02160 
02161         if (g_gametype.integer >= GT_TEAM) {
02162                 client->pers.teamInfo = qtrue;
02163         } else {
02164                 s = Info_ValueForKey( userinfo, "teamoverlay" );
02165                 if ( ! *s || atoi( s ) != 0 ) {
02166                         client->pers.teamInfo = qtrue;
02167                 } else {
02168                         client->pers.teamInfo = qfalse;
02169                 }
02170         }
02171         /*
02172         s = Info_ValueForKey( userinfo, "cg_pmove_fixed" );
02173         if ( !*s || atoi( s ) == 0 ) {
02174                 client->pers.pmoveFixed = qfalse;
02175         }
02176         else {
02177                 client->pers.pmoveFixed = qtrue;
02178         }
02179         */
02180 
02181         // team task (0 = none, 1 = offence, 2 = defence)
02182         teamTask = atoi(Info_ValueForKey(userinfo, "teamtask"));
02183         // team Leader (1 = leader, 0 is normal player)
02184         teamLeader = client->sess.teamLeader;
02185 
02186         // colors
02187         strcpy(c1, Info_ValueForKey( userinfo, "color1" ));
02188         strcpy(c2, Info_ValueForKey( userinfo, "color2" ));
02189 
02190 //      strcpy(redTeam, Info_ValueForKey( userinfo, "g_redteam" ));
02191 //      strcpy(blueTeam, Info_ValueForKey( userinfo, "g_blueteam" ));
02192 
02193         // send over a subset of the userinfo keys so other clients can
02194         // print scoreboards, display models, and play custom sounds
02195         if ( ent->r.svFlags & SVF_BOT ) {
02196                 s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i",
02197                         client->pers.netname, team, model,  c1, c2, 
02198                         client->pers.maxHealth, client->sess.wins, client->sess.losses,
02199                         Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam );
02200         } else {
02201                 if (g_gametype.integer == GT_SIEGE)
02202                 { //more crap to send
02203                         s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i",
02204                                 client->pers.netname, client->sess.sessionTeam, model, c1, c2, 
02205                                 client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam);
02206                 }
02207                 else
02208                 {
02209                         s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\st\\%s\\st2\\%s\\dt\\%i",
02210                                 client->pers.netname, client->sess.sessionTeam, model, c1, c2, 
02211                                 client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, saberName, saber2Name, client->sess.duelTeam);
02212                 }
02213         }
02214 
02215         trap_SetConfigstring( CS_PLAYERS+clientNum, s );
02216 
02217         if (modelChanged) //only going to be true for allowable server-side custom skeleton cases
02218         { //update the server g2 instance if appropriate
02219                 char *modelname = Info_ValueForKey (userinfo, "model");
02220                 SetupGameGhoul2Model(ent, modelname, NULL);
02221 
02222                 if (ent->ghoul2 && ent->client)
02223                 {
02224                         ent->client->renderInfo.lastG2 = NULL; //update the renderinfo bolts next update.
02225                 }
02226 
02227                 client->torsoAnimExecute = client->legsAnimExecute = -1;
02228                 client->torsoLastFlip = client->legsLastFlip = qfalse;
02229         }
02230 
02231         if (g_logClientInfo.integer)
02232         {
02233                 G_LogPrintf( "ClientUserinfoChanged: %i %s\n", clientNum, s );
02234         }
02235 }

void Cmd_EngageDuel_f gentity_t ent  ) 
 

Definition at line 2766 of file g_cmds.c.

References AngleVectors(), CHAN_AUTO, gentity_s::client, playerState_s::duelIndex, playerState_s::duelInProgress, playerState_s::duelTime, trace_t::entityNum, EV_PRIVATE_DUEL, playerState_s::fd, playerState_s::forceHandExtend, playerState_s::forceHandExtendTime, trace_t::fraction, G_AddEvent(), g_entities, g_gametype, G_GetStringEdString(), G_OtherPlayersDueling(), g_privateDuel, G_Sound(), gentity_t, GT_DUEL, GT_POWERDUEL, GT_TEAM, HANDEXTEND_DUELCHALLENGE, gentity_s::health, vmCvar_t::integer, gentity_s::inuse, level, MASK_PLAYERSOLID, MAX_CLIENTS, saberInfo_t::model, clientPersistant_t::netname, NULL, entityState_s::number, OnSameTeam(), playerState_s::origin, gclient_s::pers, forcedata_s::privateDuelTime, gclient_s::ps, qtrue, gentity_s::s, gclient_s::saber, playerState_s::saberHolstered, playerState_s::saberInFlight, saberInfo_t::soundOff, STAT_HEALTH, playerState_s::stats, level_locals_t::time, trap_SendServerCommand(), trap_Trace(), va(), vec3_t, playerState_s::viewangles, playerState_s::viewheight, playerState_s::weapon, playerState_s::weaponTime, and WP_SABER.

Referenced by ClientThink_real(), and StandardBotAI().

02767 {
02768         trace_t tr;
02769         vec3_t forward, fwdOrg;
02770 
02771         if (!g_privateDuel.integer)
02772         {
02773                 return;
02774         }
02775 
02776         if (g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL)
02777         { //rather pointless in this mode..
02778                 trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "NODUEL_GAMETYPE")) );
02779                 return;
02780         }
02781 
02782         //if (g_gametype.integer >= GT_TEAM && g_gametype.integer != GT_SIEGE)
02783         if (g_gametype.integer >= GT_TEAM)
02784         { //no private dueling in team modes
02785                 trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "NODUEL_GAMETYPE")) );
02786                 return;
02787         }
02788 
02789         if (ent->client->ps.duelTime >= level.time)
02790         {
02791                 return;
02792         }
02793 
02794         if (ent->client->ps.weapon != WP_SABER)
02795         {
02796                 return;
02797         }
02798 
02799         /*
02800         if (!ent->client->ps.saberHolstered)
02801         { //must have saber holstered at the start of the duel
02802                 return;
02803         }
02804         */
02805         //NOTE: No longer doing this..
02806 
02807         if (ent->client->ps.saberInFlight)
02808         {
02809                 return;
02810         }
02811 
02812         if (ent->client->ps.duelInProgress)
02813         {
02814                 return;
02815         }
02816 
02817         //New: Don't let a player duel if he just did and hasn't waited 10 seconds yet (note: If someone challenges him, his duel timer will reset so he can accept)
02818         if (ent->client->ps.fd.privateDuelTime > level.time)
02819         {
02820                 trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "CANTDUEL_JUSTDID")) );
02821                 return;
02822         }
02823 
02824         if (G_OtherPlayersDueling())
02825         {
02826                 trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", G_GetStringEdString("MP_SVGAME", "CANTDUEL_BUSY")) );
02827                 return;
02828         }
02829 
02830         AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL );
02831 
02832         fwdOrg[0] = ent->client->ps.origin[0] + forward[0]*256;
02833         fwdOrg[1] = ent->client->ps.origin[1] + forward[1]*256;
02834         fwdOrg[2] = (ent->client->ps.origin[2]+ent->client->ps.viewheight) + forward[2]*256;
02835 
02836         trap_Trace(&tr, ent->client->ps.origin, NULL, NULL, fwdOrg, ent->s.number, MASK_PLAYERSOLID);
02837 
02838         if (tr.fraction != 1 && tr.entityNum < MAX_CLIENTS)
02839         {
02840                 gentity_t *challenged = &g_entities[tr.entityNum];
02841 
02842                 if (!challenged || !challenged->client || !challenged->inuse ||
02843                         challenged->health < 1 || challenged->client->ps.stats[STAT_HEALTH] < 1 ||
02844                         challenged->client->ps.weapon != WP_SABER || challenged->client->ps.duelInProgress ||
02845                         challenged->client->ps.saberInFlight)
02846                 {
02847                         return;
02848                 }
02849 
02850                 if (g_gametype.integer >= GT_TEAM && OnSameTeam(ent, challenged))
02851                 {
02852                         return;
02853                 }
02854 
02855                 if (challenged->client->ps.duelIndex == ent->s.number && challenged->client->ps.duelTime >= level.time)
02856                 {
02857                         trap_SendServerCommand( /*challenged-g_entities*/-1, va("print \"%s %s %s!\n\"", challenged->client->pers.netname, G_GetStringEdString("MP_SVGAME", "PLDUELACCEPT"), ent->client->pers.netname) );
02858 
02859                         ent->client->ps.duelInProgress = qtrue;
02860                         challenged->client->ps.duelInProgress = qtrue;
02861 
02862                         ent->client->ps.duelTime = level.time + 2000;
02863                         challenged->client->ps.duelTime = level.time + 2000;
02864 
02865                         G_AddEvent(ent, EV_PRIVATE_DUEL, 1);
02866                         G_AddEvent(challenged, EV_PRIVATE_DUEL, 1);
02867 
02868                         //Holster their sabers now, until the duel starts (then they'll get auto-turned on to look cool)
02869 
02870                         if (!ent->client->ps.saberHolstered)
02871                         {
02872                                 if (ent->client->saber[0].soundOff)
02873                                 {
02874                                         G_Sound(ent, CHAN_AUTO, ent->client->saber[0].soundOff);
02875                                 }
02876                                 if (ent->client->saber[1].soundOff &&
02877                                         ent->client->saber[1].model[0])
02878                                 {
02879                                         G_Sound(ent, CHAN_AUTO, ent->client->saber[1].soundOff);
02880                                 }
02881                                 ent->client->ps.weaponTime = 400;
02882                                 ent->client->ps.saberHolstered = 2;
02883                         }
02884                         if (!challenged->client->ps.saberHolstered)
02885                         {
02886                                 if (challenged->client->saber[0].soundOff)
02887                                 {
02888                                         G_Sound(challenged, CHAN_AUTO, challenged->client->saber[0].soundOff);
02889                                 }
02890                                 if (challenged->client->saber[1].soundOff &&
02891                                         challenged->client->saber[1].model[0])
02892                                 {
02893                                         G_Sound(challenged, CHAN_AUTO, challenged->client->saber[1].soundOff);
02894                                 }
02895                                 challenged->client->ps.weaponTime = 400;
02896                                 challenged->client->ps.saberHolstered = 2;
02897                         }
02898                 }
02899                 else
02900                 {
02901                         //Print the message that a player has been challenged in private, only announce the actual duel initiation in private
02902                         trap_SendServerCommand( challenged-g_entities, va("cp \"%s %s\n\"", ent->client->pers.netname, G_GetStringEdString("MP_SVGAME", "PLDUELCHALLENGE")) );
02903                         trap_SendServerCommand( ent-g_entities, va("cp \"%s %s\n\"", G_GetStringEdString("MP_SVGAME", "PLDUELCHALLENGED"), challenged->client->pers.netname) );
02904                 }
02905 
02906                 challenged->client->ps.fd.privateDuelTime = 0; //reset the timer in case this player just got out of a duel. He should still be able to accept the challenge.
02907 
02908                 ent->client->ps.forceHandExtend = HANDEXTEND_DUELCHALLENGE;
02909                 ent->client->ps.forceHandExtendTime = level.time + 1000;
02910 
02911                 ent->client->ps.duelIndex = challenged->s.number;
02912                 ent->client->ps.duelTime = level.time + 5000;
02913         }
02914 }

void Cmd_FollowCycle_f gentity_t ent,
int  dir
 

Definition at line 1419 of file g_cmds.c.

References gentity_s::client, level_locals_t::clients, CON_CONNECTED, clientPersistant_t::connected, G_Error(), g_gametype, gentity_t, GT_DUEL, GT_POWERDUEL, vmCvar_t::integer, level, clientSession_t::losses, level_locals_t::maxclients, gclient_s::pers, gclient_s::sess, clientSession_t::sessionTeam, SetTeam(), SPECTATOR_FOLLOW, SPECTATOR_NOT, clientSession_t::spectatorClient, clientSession_t::spectatorState, TEAM_FREE, and TEAM_SPECTATOR.

Referenced by ClientCommand(), and SpectatorThink().

01419                                                   {
01420         int             clientnum;
01421         int             original;
01422 
01423         // if they are playing a tournement game, count as a loss
01424         if ( (g_gametype.integer == GT_DUEL || g_gametype.integer == GT_POWERDUEL)
01425                 && ent->client->sess.sessionTeam == TEAM_FREE ) {\
01426                 //WTF???
01427                 ent->client->sess.losses++;
01428         }
01429         // first set them to spectator
01430         if ( ent->client->sess.spectatorState == SPECTATOR_NOT ) {
01431                 SetTeam( ent, "spectator" );
01432         }
01433 
01434         if ( dir != 1 && dir != -1 ) {
01435                 G_Error( "Cmd_FollowCycle_f: bad dir %i", dir );
01436         }
01437 
01438         clientnum = ent->client->sess.spectatorClient;
01439         original = clientnum;
01440         do {
01441                 clientnum += dir;
01442                 if ( clientnum >= level.maxclients ) {
01443                         clientnum = 0;
01444                 }
01445                 if ( clientnum < 0 ) {
01446                         clientnum = level.maxclients - 1;
01447                 }
01448 
01449                 // can only follow connected clients
01450                 if ( level.clients[ clientnum ].pers.connected != CON_CONNECTED ) {
01451                         continue;
01452                 }
01453 
01454                 // can't follow another spectator
01455                 if ( level.clients[ clientnum ].sess.sessionTeam == TEAM_SPECTATOR ) {
01456                         continue;
01457                 }
01458 
01459                 // this is good, we can use it
01460                 ent->client->sess.spectatorClient = clientnum;
01461                 ent->client->sess.spectatorState = SPECTATOR_FOLLOW;
01462                 return;
01463         } while ( clientnum != original );
01464 
01465         // leave it where it was
01466 }

void Cmd_SaberAttackCycle_f gentity_t ent  ) 
 

Definition at line 2547 of file g_cmds.c.

References bgSiegeClasses, saberInfo_t::bladeStyle2Start, CHAN_AUTO, gentity_s::client, d_saberStanceDebug, playerState_s::fd, FORCE_LEVEL_1, forcedata_s::forcePowerLevel, FP_SABER_OFFENSE, g_entities, g_gametype, G_Sound(), gentity_t, GT_SIEGE, vmCvar_t::integer, saberInfo_t::model, saberInfo_t::numBlades, gclient_s::ps, qboolean, qfalse, qtrue, gclient_s::saber, forcedata_s::saberAnimLevel, forcedata_s::saberAnimLevelBase, gclient_s::saberCycleQueue, saberInfo_t::saberFlags2, playerState_s::saberHolstered, playerState_s::saberInFlight, SFL2_NO_MANUAL_DEACTIVATE, SFL2_NO_MANUAL_DEACTIVATE2, gclient_s::siegeClass, saberInfo_t::singleBladeStyle, saberInfo_t::soundOff, saberInfo_t::soundOn, SS_DUAL, SS_FAST, SS_NONE, SS_NUM_SABER_STYLES, saberInfo_t::stylesForbidden, trap_SendServerCommand(), va(), playerState_s::weaponTime, WP_SaberCanTurnOffSomeBlades(), and WP_UseFirstValidSaberStyle().

Referenced by ClientThink_real(), and StandardBotAI().

02548 {
02549         int selectLevel = 0;
02550         qboolean usingSiegeStyle = qfalse;
02551         
02552         if ( !ent || !ent->client )
02553         {
02554                 return;
02555         }
02556         /*
02557         if (ent->client->ps.weaponTime > 0)
02558         { //no switching attack level when busy
02559                 return;
02560         }
02561         */
02562 
02563         if (ent->client->saber[0].model[0] && ent->client->saber[1].model[0])
02564         { //no cycling for akimbo
02565                 if ( WP_SaberCanTurnOffSomeBlades( &ent->client->saber[1] ) )
02566                 {//can turn second saber off 
02567                         if ( ent->client->ps.saberHolstered == 1 )
02568                         {//have one holstered
02569                                 //unholster it
02570                                 G_Sound(ent, CHAN_AUTO, ent->client->saber[1].soundOn);
02571                                 ent->client->ps.saberHolstered = 0;
02572                                 //g_active should take care of this, but...
02573                                 ent->client->ps.fd.saberAnimLevel = SS_DUAL;
02574                         }
02575                         else if ( ent->client->ps.saberHolstered == 0 )
02576                         {//have none holstered
02577                                 if ( (ent->client->saber[1].saberFlags2&SFL2_NO_MANUAL_DEACTIVATE) )
02578                                 {//can't turn it off manually
02579                                 }
02580                                 else if ( ent->client->saber[1].bladeStyle2Start > 0
02581                                         && (ent->client->saber[1].saberFlags2&SFL2_NO_MANUAL_DEACTIVATE2) )
02582                                 {//can't turn it off manually
02583                                 }
02584                                 else
02585                                 {
02586                                         //turn it off
02587                                         G_Sound(ent, CHAN_AUTO, ent->client->saber[1].soundOff);
02588                                         ent->client->ps.saberHolstered = 1;
02589                                         //g_active should take care of this, but...
02590                                         ent->client->ps.fd.saberAnimLevel = SS_FAST;
02591                                 }
02592                         }
02593 
02594                         if (d_saberStanceDebug.integer)
02595                         {
02596                                 trap_SendServerCommand( ent-g_entities, va("print \"SABERSTANCEDEBUG: Attempted to toggle dual saber blade.\n\"") );
02597                         }
02598                         return;
02599                 }
02600         }
02601         else if (ent->client->saber[0].numBlades > 1
02602                 && WP_SaberCanTurnOffSomeBlades( &ent->client->saber[0] ) )
02603         { //use staff stance then.
02604                 if ( ent->client->ps.saberHolstered == 1 )
02605                 {//second blade off
02606                         if ( ent->client->ps.saberInFlight )
02607                         {//can't turn second blade back on if it's in the air, you naughty boy!
02608                                 if (d_saberStanceDebug.integer)
02609                                 {
02610                                         trap_SendServerCommand( ent-g_entities, va("print \"SABERSTANCEDEBUG: Attempted to toggle staff blade in air.\n\"") );
02611                                 }
02612                                 return;
02613                         }
02614                         //turn it on
02615                         G_Sound(ent, CHAN_AUTO, ent->client->saber[0].soundOn);
02616                         ent->client->ps.saberHolstered = 0;
02617                         //g_active should take care of this, but...
02618                         if ( ent->client->saber[0].stylesForbidden )
02619                         {//have a style we have to use
02620                                 WP_UseFirstValidSaberStyle( &ent->client->saber[0], &ent->client->saber[1], ent->client->ps.saberHolstered, &selectLevel );
02621                                 if ( ent->client->ps.weaponTime <= 0 )
02622                                 { //not busy, set it now
02623                                         ent->client->ps.fd.saberAnimLevel = selectLevel;
02624                                 }
02625                                 else
02626                                 { //can't set it now or we might cause unexpected chaining, so queue it
02627                                         ent->client->saberCycleQueue = selectLevel;
02628                                 }
02629                         }
02630                 }
02631                 else if ( ent->client->ps.saberHolstered == 0 )
02632                 {//both blades on
02633                         if ( (ent->client->saber[0].saberFlags2&SFL2_NO_MANUAL_DEACTIVATE) )
02634                         {//can't turn it off manually
02635                         }
02636                         else if ( ent->client->saber[0].bladeStyle2Start > 0
02637                                 && (ent->client->saber[0].saberFlags2&SFL2_NO_MANUAL_DEACTIVATE2) )
02638                         {//can't turn it off manually
02639                         }
02640                         else
02641                         {
02642                                 //turn second one off
02643                                 G_Sound(ent, CHAN_AUTO, ent->client->saber[0].soundOff);
02644                                 ent->client->ps.saberHolstered = 1;
02645                                 //g_active should take care of this, but...
02646                                 if ( ent->client->saber[0].singleBladeStyle != SS_NONE )
02647                                 {
02648                                         if ( ent->client->ps.weaponTime <= 0 )
02649                                         { //not busy, set it now
02650                                                 ent->client->ps.fd.saberAnimLevel = ent->client->saber[0].singleBladeStyle;
02651                                         }
02652                                         else
02653                                         { //can't set it now or we might cause unexpected chaining, so queue it
02654                                                 ent->client->saberCycleQueue = ent->client->saber[0].singleBladeStyle;
02655                                         }
02656                                 }
02657                         }
02658                 }
02659                 if (d_saberStanceDebug.integer)
02660                 {
02661                         trap_SendServerCommand( ent-g_entities, va("print \"SABERSTANCEDEBUG: Attempted to toggle staff blade.\n\"") );
02662                 }
02663                 return;
02664         }
02665 
02666         if (ent->client->saberCycleQueue)
02667         { //resume off of the queue if we haven't gotten a chance to update it yet
02668                 selectLevel = ent->client->saberCycleQueue;
02669         }
02670         else
02671         {
02672                 selectLevel = ent->client->ps.fd.saberAnimLevel;
02673         }
02674 
02675         if (g_gametype.integer == GT_SIEGE &&
02676                 ent->client->siegeClass != -1 &&
02677                 bgSiegeClasses[ent->client->siegeClass].saberStance)
02678         { //we have a flag of useable stances so cycle through it instead
02679                 int i = selectLevel+1;
02680 
02681                 usingSiegeStyle = qtrue;
02682 
02683                 while (i != selectLevel)
02684                 { //cycle around upward til we hit the next style or end up back on this one
02685                         if (i >= SS_NUM_SABER_STYLES)
02686                         { //loop back around to the first valid
02687                                 i = SS_FAST;
02688                         }
02689 
02690                         if (bgSiegeClasses[ent->client->siegeClass].saberStance & (1 << i))
02691                         { //we can use this one, select it and break out.
02692                                 selectLevel = i;
02693                                 break;
02694                         }
02695                         i++;
02696                 }
02697 
02698                 if (d_saberStanceDebug.integer)
02699                 {
02700                         trap_SendServerCommand( ent-g_entities, va("print \"SABERSTANCEDEBUG: Attempted to cycle given class stance.\n\"") );
02701                 }
02702         }
02703         else
02704         {
02705                 selectLevel++;
02706                 if ( selectLevel > ent->client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE] )
02707                 {
02708                         selectLevel = FORCE_LEVEL_1;
02709                 }
02710                 if (d_saberStanceDebug.integer)
02711                 {
02712                         trap_SendServerCommand( ent-g_entities, va("print \"SABERSTANCEDEBUG: Attempted to cycle stance normally.\n\"") );
02713                 }
02714         }
02715 /*
02716 #ifndef FINAL_BUILD
02717         switch ( selectLevel )
02718         {
02719         case FORCE_LEVEL_1:
02720                 trap_SendServerCommand( ent-g_entities, va("print \"Lightsaber Combat Style: %sfast\n\"", S_COLOR_BLUE) );
02721                 break;
02722         case FORCE_LEVEL_2:
02723 <