Local definitions for game module. More...
#include "q_shared.h"
#include "inventory.h"
#include "../shared/infostring.h"
#include "lua/lua.h"
#include "game.h"
Go to the source code of this file.
Data Structures | |
struct | game_locals_t |
this structure is left intact through an entire game it should be initialized at game library load time More... | |
struct | level_locals_t |
this structure is cleared as each map is entered More... | |
struct | spawn_temp_t |
this is only used to hold entity field values that can be set from the editor, but aren't actually present in edict_t during gameplay More... | |
struct | shot_mock_t |
used in shot probability calculations (pseudo shots) More... | |
struct | moveinfo_t |
actor movement More... | |
struct | client_persistant_t |
client data that stays across multiple level loads More... | |
struct | player_s |
this structure is cleared on each PutClientInServer(), except for 'client->pers' More... | |
struct | AI_s |
Artificial intelligence of a character. More... | |
struct | edict_s |
Everything that is not in the bsp tree is an edict, the spawnpoints, the actors, the misc_models, the weapons and so on. More... | |
Defines | |
#define | _(String) String |
#define | ngettext(x, y, cnt) x |
#define | GAME_INCLUDE |
#define | GAMEVERSION "baseufo" |
#define | MAX_SPOT_DIST 4096 |
#define | PM_ALL 0xFFFFFFFF |
#define | TEAM_ALL 0xFFFFFFFF |
#define | G_PlayerToPM(player) ((player)->num < game.sv_maxplayersperteam ? 1 << ((player)->num) : 0) |
#define | SERVER_FRAME_SECONDS 0.1 |
#define | TAG_GAME 765 |
#define | TAG_LEVEL 766 |
#define | CONTAINER(e, containerID) ((e)->chr.i.c[(containerID)]) |
#define | ARMOUR(e) (CONTAINER(e, gi.csi->idArmour)) |
#define | RIGHT(e) (CONTAINER(e, gi.csi->idRight)) |
#define | LEFT(e) (CONTAINER(e, gi.csi->idLeft)) |
#define | EXTENSION(e) (CONTAINER(e, gi.csi->idExtension)) |
#define | HEADGEAR(e) (CONTAINER(e, gi.csi->idHeadgear)) |
#define | FLOOR(e) (CONTAINER(e, gi.csi->idFloor)) |
#define | INVDEF(containerID) (&gi.csi->ids[(containerID)]) |
#define | ACTOR_VIS_100 1.0 |
#define | ACTOR_VIS_50 0.5 |
#define | ACTOR_VIS_10 0.1 |
#define | ACTOR_VIS_0 0.0 |
#define | G_FreeTags(tag) gi.FreeTags((tag), __FILE__, __LINE__) |
#define | G_TagMalloc(size, tag) gi.TagMalloc((size), (tag), __FILE__, __LINE__) |
#define | G_MemFree(ptr) gi.TagFree((ptr), __FILE__, __LINE__) |
#define | G_PLAYER_FROM_ENT(ent) (game.players + (ent)->pnum) |
#define | random() ((rand() & 0x7fff) / ((float)0x7fff)) |
#define | crandom() (2.0 * (random() - 0.5)) |
#define | G_IsState(ent, s) ((ent)->state & (s)) |
#define | G_IsShaken(ent) G_IsState(ent, STATE_SHAKEN) |
#define | G_IsStunned(ent) (G_IsState(ent, STATE_STUN) & ~STATE_DEAD) |
#define | G_IsPaniced(ent) G_IsState(ent, STATE_PANIC) |
#define | G_IsReaction(ent) G_IsState(ent, STATE_REACTION) |
#define | G_IsRaged(ent) G_IsState(ent, STATE_RAGE) |
#define | G_IsInsane(ent) G_IsState(ent, STATE_INSANE) |
#define | G_IsDazed(ent) G_IsState(ent, STATE_DAZED) |
#define | G_IsCrouched(ent) G_IsState(ent, STATE_CROUCHED) |
#define | G_IsDead(ent) G_IsState(ent, STATE_DEAD) |
#define | G_IsActor(ent) ((ent)->type == ET_ACTOR || (ent)->type == ET_ACTOR2x2) |
#define | G_IsBreakable(ent) ((ent)->flags & FL_DESTROYABLE) |
#define | G_IsBrushModel(ent) ((ent)->type == ET_BREAKABLE || (ent)->type == ET_DOOR) |
#define | G_IsVisibleOnBattlefield(ent) (G_IsActor((ent)) || (ent)->type == ET_ITEM || (ent)->type == ET_PARTICLE) |
#define | G_IsAI(ent) (G_PLAYER_FROM_ENT((ent))->pers.ai) |
#define | G_IsAIPlayer(player) ((player)->pers.ai) |
#define | G_TeamToVisMask(team) (1 << (team)) |
#define | G_IsVisibleForTeam(ent, team) ((ent)->visflags & G_TeamToVisMask(team)) |
#define | G_IsCivilian(ent) ((ent)->team == TEAM_CIVILIAN) |
#define | G_IsAlien(ent) ((ent)->team == TEAM_ALIEN) |
#define | G_IsBlockingMovementActor(ent) (((ent)->type == ET_ACTOR && !G_IsDead(ent)) || ent->type == ET_ACTOR2x2) |
#define | G_ToggleState(ent, s) (ent)->state ^= (s) |
#define | G_ToggleCrouched(ent) G_ToggleState(ent, STATE_CROUCHED) |
#define | G_SetState(ent, s) (ent)->state |= (s) |
#define | G_SetShaken(ent) G_SetState((ent), STATE_SHAKEN) |
#define | G_SetDazed(ent) G_SetState((ent), STATE_DAZED) |
#define | G_SetStunned(ent) G_SetState((ent), STATE_STUN) |
#define | G_SetDead(ent) G_SetState((ent), STATE_DEAD) |
#define | G_SetInsane(ent) G_SetState((ent), STATE_INSANE) |
#define | G_SetRage(ent) G_SetState((ent), STATE_RAGE) |
#define | G_SetPanic(ent) G_SetState((ent), STATE_PANIC) |
#define | G_SetCrouched(ent) G_SetState((ent), STATE_CROUCHED) |
#define | G_RemoveState(ent, s) (ent)->state &= ~(s) |
#define | G_RemoveShaken(ent) G_RemoveState((ent), STATE_SHAKEN) |
#define | G_RemoveDazed(ent) G_RemoveState((ent), STATE_DAZED) |
#define | G_RemoveStunned(ent) G_RemoveState((ent), STATE_STUN) |
#define | G_RemoveDead(ent) G_RemoveState((ent), STATE_DEAD) |
#define | G_RemoveInsane(ent) G_RemoveState((ent), STATE_INSANE) |
#define | G_RemoveRage(ent) G_RemoveState((ent), STATE_RAGE) |
#define | G_RemovePanic(ent) G_RemoveState((ent), STATE_PANIC) |
#define | G_RemoveCrouched(ent) G_RemoveState((ent), STATE_CROUCHED) |
#define | G_RemoveReaction(ent) G_RemoveState((ent), STATE_REACTION) |
#define | FFL_SPAWNTEMP 1 |
#define | FFL_NOSPAWN 2 |
#define | VIS_APPEAR 1 |
#define | VIS_PERISH 2 |
#define | VIS_CHANGE 1 |
#define | VIS_YES 2 |
#define | VIS_STOP 4 |
#define | VT_PERISH 1 |
#define | VT_NOFRUSTUM 2 |
#define | MORALE_RANDOM(mod) ( (mod) * (1.0 + 0.3*crand()) ) |
#define | MAX_DVTAB 32 |
#define | FL_GROUPSLAVE 0x00000008 |
not the first on the team | |
#define | FL_DESTROYABLE 0x00000004 |
If an edict is destroyable (like ET_BREAKABLE, ET_DOOR [if health set] or maybe a ET_MISSION [if health set]). | |
#define | FL_TRIGGERED 0x00000100 |
Trigger the edict at spawn. | |
Typedefs | |
typedef struct AI_s | AI_t |
Artificial intelligence of a character. | |
Enumerations | |
enum | edictMaterial_t { MAT_GLASS, MAT_METAL, MAT_ELECTRICAL, MAT_WOOD, MAT_MAX } |
e.g. used for breakable objects More... | |
Functions | |
void | G_SendPlayerStats (const player_t *player) |
Write player stats to network buffer. | |
void | G_WriteItem (const item_t *item, const invDef_t *container, int x, int y) |
Write an item to the network buffer. | |
void | G_ReadItem (item_t *item, invDef_t **container, int *x, int *y) |
Read item from the network buffer. | |
void | G_InventoryToFloor (edict_t *ent) |
Move items to adjacent locations if the containers on the current floor edict are full. | |
qboolean | G_AddItemToFloor (const pos3_t pos, const char *itemID) |
Adds a new item to an existing or new floor container edict at the given grid location. | |
edict_t * | G_GetFloorItemsFromPos (const pos3_t pos) |
Callback to G_GetEdictFromPos() for given position, used to get items from position. | |
void | G_MoraleBehaviour (int team) |
Applies morale behaviour on actors. | |
void | G_PhysicsRun (void) |
Handles door and other objects. | |
void | G_PhysicsStep (edict_t *ent) |
void | G_ActorReserveTUs (edict_t *ent, int resReaction, int resShot, int resCrouch) |
Reserves TUs for different actor actions. | |
int | G_ActorGetTUForReactionFire (const edict_t *ent) |
Calculates the amount of TUs that are needed for the current selected reaction fire mode. | |
int | G_ActorUsableTUs (const edict_t *ent) |
Calculates the amount of usable TUs. This is without the reserved TUs. | |
int | G_ActorGetReservedTUs (const edict_t *ent) |
Calculates the amount of all currently reserved TUs. | |
void | G_ActorCheckRevitalise (edict_t *ent) |
qboolean | G_MissionTouch (edict_t *self, edict_t *activator) |
Mission trigger. | |
qboolean | G_MissionUse (edict_t *self, edict_t *activator) |
Mission trigger use function. | |
qboolean | G_MissionDestroy (edict_t *self) |
Mission trigger destroy function. | |
void | G_MissionThink (edict_t *self) |
edict_t * | G_Find (edict_t *from, int fieldofs, char *match) |
Searches all active entities for the next one that holds the matching string at fieldofs (use the offsetof() macro) in the structure. | |
edict_t * | G_FindRadius (edict_t *from, const vec3_t org, float rad, entity_type_t type) |
Returns entities that have origins within a spherical area. | |
edict_t * | G_FindTargetEntity (const char *target) |
Searches the edict that has the given target as targetname set. | |
const char * | G_GetPlayerName (int pnum) |
Returns the player name for a give player number. | |
player_t * | G_GetPlayerForTeam (int team) |
Gets player for given team. | |
int | G_GetActiveTeam (void) |
Returns the current active team to the server. | |
const char * | G_GetWeaponNameForFiredef (const fireDef_t *fd) |
Returns the corresponding weapon name for a given fire definition. | |
void | G_PrintActorStats (const edict_t *victim, const edict_t *attacker, const fireDef_t *fd) |
Prints stats about who killed who with what and how. | |
void | G_PrintStats (const char *buffer) |
Prints stats to game console and stats log file. | |
int | G_TouchTriggers (edict_t *ent) |
Check the world against triggers for the current entity. | |
void | G_TouchSolids (edict_t *ent) |
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it covers to immediately touch it. | |
void | G_TouchEdicts (edict_t *ent, float extend) |
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it covers to immediately touch it. | |
edict_t * | G_Spawn (void) |
Either finds a free edict, or allocates a new one. | |
edict_t * | G_SpawnParticle (const vec3_t origin, int spawnflags, const char *particle) |
void | G_FreeEdict (edict_t *e) |
Marks the edict as free. | |
qboolean | G_UseEdict (edict_t *ent, edict_t *activator) |
Call the 'use' function for the given edict and all its group members. | |
edict_t * | G_GetEdictFromPos (const pos3_t pos, const entity_type_t type) |
Searches an edict of the given type at the given grid location. | |
void | G_TakeDamage (edict_t *ent, int damage) |
Applies the given damage value to an edict that is either an actor or has the FL_DESTROYABLE flag set. | |
trace_t | G_Trace (const vec3_t start, const vec3_t end, const edict_t *passent, int contentmask) |
collision detection - this version is more accurate and includes entity tests | |
qboolean | G_TestLineWithEnts (const vec3_t start, const vec3_t end) |
fast version of a line trace including entities | |
qboolean | G_TestLine (const vec3_t start, const vec3_t end) |
fast version of a line trace but without including entities | |
void | G_ReactionFirePreShot (const edict_t *target, const int fdTime) |
Called when 'target' is about to shoot, this forces a 'draw' to decide who gets the first shot. | |
void | G_ReactionFirePostShot (edict_t *target) |
Called after 'target' has fired, this might trigger more reaction fire or resolve outstanding reaction fire (because target is out of time). | |
void | G_ReactionFireReset (int team) |
Guess! Reset all "shaken" states on end of turn? | |
qboolean | G_ReactionFireCanBeEnabled (const edict_t *ent) |
Checks whether the actor is allowed to activate reaction fire and will informs the player about the reason if this would not work. | |
qboolean | G_ReactionFireSetDefault (edict_t *ent) |
void | G_ReactionFireUpdate (edict_t *ent, fireDefIndex_t fmIdx, actorHands_t hand, const objDef_t *od) |
Updates the reaction fire settings in case something was moved into a hand or from a hand that would make the current settings invalid. | |
qboolean | G_ReactionFireOnMovement (edict_t *target) |
Called when 'target' moves, possibly triggering or resolving reaction fire. | |
void | G_ReactionFireEndTurn (void) |
Called at the end of turn, all outstanding reaction fire is resolved. | |
void | G_CompleteRecalcRouting (void) |
void | G_RecalcRouting (const edict_t *ent) |
void | G_GenerateEntList (const char *entList[MAX_EDICTS]) |
creates an entity list | |
void | G_EventSpawnSound (const edict_t *ent, const vec3_t origin, const char *sound) |
Spawns a sound for all connected clients (that will be spatialized on the client side). | |
void | G_EventActorTurn (const edict_t *ent) |
Send the turn event for the given entity. | |
void | G_EventActorFall (const edict_t *ent) |
void | G_EventActorDie (const edict_t *ent) |
Announce the actor die event for the clients that are seeing the actor. | |
void | G_EventActorRevitalise (const edict_t *ent) |
Announce the actor die event for the clients that are seeing the actor. | |
void | G_EventActorSendReservations (const edict_t *ent) |
Will inform the player about the real TU reservation. | |
void | G_EventInventoryDelete (const edict_t *ent, int playerMask, const invDef_t *invDef, int x, int y) |
Tell the client to remove the item from the container. | |
void | G_EventInventoryAdd (const edict_t *ent, int playerMask, int itemAmount) |
Tell the client to add the item from the container. | |
void | G_EventPerish (const edict_t *ent) |
Send an event to all clients that are seeing the given edict, that it just has disappeared. | |
void | G_EventDestroyEdict (const edict_t *ent) |
Unregister an edict at the client. | |
void | G_EventInventoryAmmo (const edict_t *ent, const objDef_t *ammo, int amount, shoot_types_t shootType) |
Change the amount of available ammo for the given entity. | |
void | G_EventStartShoot (const edict_t *ent, int visMask, shoot_types_t shootType, const pos3_t at) |
Start the shooting event. | |
void | G_EventShootHidden (int visMask, const fireDef_t *fd, qboolean firstShoot) |
Start the shooting event for hidden actors. | |
void | G_EventShoot (const edict_t *ent, int visMask, const fireDef_t *fd, qboolean firstShoot, shoot_types_t shootType, int flags, const trace_t *trace, const vec3_t from, const vec3_t impact) |
Do the shooting. | |
void | G_EventSetClientAction (const edict_t *ent) |
Informs the client that an interaction with the world is possible. | |
void | G_EventResetClientAction (const edict_t *ent) |
Reset the client actions for the given entity. | |
void | G_EventActorStats (const edict_t *ent) |
void | G_EventEndRound (void) |
End of round event for the current active team. | |
void | G_EventInventoryReload (const edict_t *ent, int playerMask, const item_t *item, const invDef_t *invDef, const invList_t *ic) |
void | G_EventThrow (int visMask, const fireDef_t *fd, float dt, byte flags, const vec3_t position, const vec3_t velocity) |
void | G_EventReactionFireChange (const edict_t *ent) |
void | G_EventParticleSpawn (int playerMask, const char *name, int levelFlags, const vec3_t s, const vec3_t v, const vec3_t a) |
Spawn a new particle for the client. | |
void | G_EventSendEdict (const edict_t *ent) |
Send the bounding box info to the client. | |
edict_t * | G_ClientGetFreeSpawnPointForActorSize (const player_t *player, const actorSizeEnum_t actorSize) |
Searches a free spawning point for a given actor size. | |
qboolean | G_ClientUseEdict (const player_t *player, edict_t *actor, edict_t *door) |
This function 'uses' the edict. E.g. it opens the door when the player wants it to open. | |
qboolean | G_ActionCheckForCurrentTeam (const player_t *player, edict_t *ent, int TU) |
Checks whether the requested action is possible for the current active team. | |
qboolean | G_ActionCheckWithoutTeam (const player_t *player, edict_t *ent, int TU) |
Checks whether the requested action is possible. | |
void | G_SendStats (edict_t *ent) __attribute__((nonnull)) |
Send stats to network buffer. | |
edict_t * | G_SpawnFloor (const pos3_t pos) |
Spawns a new entity at the floor. | |
int | G_CheckVisTeam (const int team, edict_t *check, qboolean perish, const edict_t *ent) |
Checks whether an edict appear/perishes for a specific team - also updates the visflags each edict carries. | |
int | G_CheckVisTeamAll (const int team, qboolean perish, const edict_t *ent) |
Do G_CheckVisTeam for all entities. | |
edict_t * | G_GetFloorItems (edict_t *ent) __attribute__((nonnull)) |
Prepares a list of items on the floor at given entity position. | |
qboolean | G_InventoryRemoveItemByID (const char *itemID, edict_t *ent, containerIndex_t index) |
Removes one particular item from a given container. | |
void | G_SendState (unsigned int playerMask, const edict_t *ent) |
void | G_SetTeamForPlayer (player_t *player, const int team) |
void | G_CenterView (const edict_t *ent) |
Centers the view for all clients that are seeing the given edict on the world position of the edict. | |
qboolean | G_ActorIsInRescueZone (const edict_t *actor) |
Checks whether the given actor is currently standing in a rescue zone. | |
void | G_ActorSetInRescueZone (edict_t *actor, qboolean inRescueZone) |
Set the rescue zone data. | |
void | G_ActorUseDoor (edict_t *actor, edict_t *door) |
Make the actor use (as in open/close) a door edict. | |
qboolean | G_IsLivingActor (const edict_t *ent) __attribute__((nonnull)) |
Checks whether the given edict is a living actor. | |
void | G_ActorSetClientAction (edict_t *actor, edict_t *ent) |
Handles the client actions (interaction with the world). | |
edict_t * | G_ActorGetByUCN (const int ucn, const int team) |
Searches an actor by a unique character number. | |
void | G_CheckForceEndRound (void) |
Check whether a forced round end should be executed. | |
void | G_ActorDieOrStun (edict_t *ent, edict_t *attacker) |
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die, otherwise the actor will get stunned. | |
void | G_ActorSetMaxs (edict_t *ent) |
Sets correct bounding box for actor (state dependent). | |
void | G_ActorGiveTimeUnits (edict_t *ent) |
Set time units for the given edict. Based on speed skills. | |
void | G_ActorSetTU (edict_t *ent, int tus) |
void | G_ActorUseTU (edict_t *ent, int tus) |
int | G_ClientAction (player_t *player) |
The client sent us a message that he did something. We now execute the related fucntion(s) adn notify him if neccessary. | |
void | G_ClientEndRound (player_t *player) |
void | G_ClientTeamInfo (const player_t *player) |
The client lets the server spawn the actors for a given player by sending their information (models, inventory, etc..) over the network. | |
void | G_ClientInitActorStates (const player_t *player) |
This is called after the actors are spawned and will set actor states without consuming TUs. | |
int | G_ClientGetTeamNum (const player_t *player) |
Returns the assigned team number of the player. | |
int | G_ClientGetTeamNumPref (const player_t *player) |
Returns the preferred team number for the player. | |
qboolean | G_ClientIsReady (const player_t *player) |
void | G_ClientPrintf (const player_t *player, int printlevel, const char *fmt,...) __attribute__((format(printf |
void void | G_ResetClientData (void) |
Called after every player has joined. | |
void | G_ClientCommand (player_t *player) |
void | G_ClientUserinfoChanged (player_t *player, char *userinfo) |
called whenever the player updates a userinfo variable. | |
qboolean | G_ClientBegin (player_t *player) |
This functions starts the client. | |
void | G_ClientSpawn (player_t *player) |
Sets the team, init the TU and sends the player stats. | |
qboolean | G_ClientConnect (player_t *player, char *userinfo, size_t userinfoSize) |
Checks whether the connection is valid or invalid and set some user info keys. | |
void | G_ClientDisconnect (player_t *player) |
void | G_ActorReload (edict_t *ent, const invDef_t *invDef) |
Reload weapon with actor. | |
qboolean | G_ClientCanReload (edict_t *ent, containerIndex_t containerID) |
Returns true if actor can reload weapon. | |
void | G_ClientGetWeaponFromInventory (edict_t *ent) |
Retrieve or collect weapon from any linked container for the actor. | |
void | G_ClientMove (const player_t *player, int visTeam, edict_t *ent, const pos3_t to) |
Generates the client events that are send over the netchannel to move an actor. | |
void | G_ActorFall (edict_t *ent) |
Let an actor fall down if e.g. the func_breakable the actor was standing on was destroyed. | |
void | G_MoveCalc (int team, const edict_t *movingActor, const pos3_t from, byte crouchingState, int distance) |
Precalculates a move table for a given team and a given starting position. This will calculate a routing table for all reachable fields with the given distance from the given spot with the given actorsize. | |
void | G_MoveCalcLocal (pathing_t *pt, int team, const edict_t *movingActor, const pos3_t from, byte crouchingState, int distance) |
Same as G_MoveCalc , except that it uses the pathing table passed as the first param. | |
void | G_ActorInvMove (edict_t *ent, const invDef_t *from, invList_t *fItem, const invDef_t *to, int tx, int ty, qboolean checkaction) |
Moves an item inside an inventory. Floors are handled special. | |
void | G_ClientStateChange (const player_t *player, edict_t *ent, int reqState, qboolean checkaction) |
Changes the state of a player/soldier. | |
int | G_ActorDoTurn (edict_t *ent, byte dir) |
Turns an actor around. | |
edict_t * | G_GetActorFromPos (const pos3_t pos) |
Searches an actor on the given grid position. | |
void | G_SendInvisible (player_t *player) |
This function sends all the actors to the client that are not visible initially - this is needed because an actor can e.g. produce sounds that are send over the net. And the client can only handle them if he knows the le_t (local entity) already. | |
void | G_GiveTimeUnits (int team) |
Network function to update the time units (TUs) for each team-member. | |
void | G_AppearPerishEvent (unsigned int player_mask, qboolean appear, edict_t *check, const edict_t *ent) |
Send the appear or perish event to the affected clients. | |
unsigned int | G_VisToPM (unsigned int vis_mask) |
Converts vis mask to player mask. | |
void | G_SendInventory (unsigned int player_mask, const edict_t *ent) |
Sends whole inventory through the network buffer. | |
unsigned int | G_TeamToPM (int team) |
Generates the player bit mask for a given team. | |
void | G_SpawnEntities (const char *mapname, qboolean day, const char *entities) |
Creates a server's entity / program execution context by parsing textual entity definitions out of an ent file. | |
qboolean | G_RunFrame (void) |
qboolean | G_FrustumVis (const edict_t *from, const vec3_t point) |
Checks whether a point is "visible" from the edicts position. | |
float | G_ActorVis (const vec3_t from, const edict_t *check, qboolean full) |
calculate how much check is "visible" from from | |
void | G_ClearVisFlags (int team) |
Reset the visflags for all edicts in the global list for the given team - and only for the given team. | |
int | G_CheckVis (edict_t *check, qboolean perish) |
Check if the edict appears/perishes for the other teams. If they appear for other teams, the needed information for those clients are also send in G_CheckVisTeam resp. G_AppearPerishEvent . | |
int | G_CheckVisPlayer (player_t *player, qboolean perish) |
Sets visible edict on player spawn. | |
int | G_TestVis (const int team, edict_t *check, int flags) |
test if check is visible by team (or if visibility changed?) | |
float | G_Vis (const int team, const edict_t *from, const edict_t *check, int flags) |
test if check is visible by from | |
qboolean | G_ClientShoot (const player_t *player, edict_t *ent, const pos3_t at, shoot_types_t shootType, fireDefIndex_t firemode, shot_mock_t *mock, qboolean allowReaction, int z_align) |
Setup for shooting, either real or mock. | |
void | G_AddToWayPointList (edict_t *ent) |
void | AI_Run (void) |
Every server frame one single actor is handled - always in the same order. | |
void | AI_ActorThink (player_t *player, edict_t *ent) |
The think function for the ai controlled aliens. | |
player_t * | AI_CreatePlayer (int team) |
Spawn civilians and aliens. | |
qboolean | AI_CheckUsingDoor (const edict_t *ent, const edict_t *door) |
Checks whether the AI controlled actor wants to use a door. | |
void | G_ServerCommand (void) |
ServerCommand will be called when an "sv" command is issued. The game can issue gi.Cmd_Argc() / gi.Cmd_Argv() commands to get the rest of the parameters. | |
qboolean | SV_FilterPacket (const char *from) |
qboolean | G_MatchIsRunning (void) |
Checks whether the game is running (active team and no intermission time). | |
void | G_MatchEndTrigger (int team, int timeGap) |
Triggers the end of the game. Will be executed in the next server (or game) frame. | |
void | G_MatchEndCheck (void) |
Checks whether there are still actors to fight with left. If non are the match end will be triggered. | |
qboolean | G_MatchDoEnd (void) |
Checks whether a match is over. | |
edict_t * | G_TriggerSpawn (edict_t *owner) |
void | SP_trigger_hurt (edict_t *ent) |
Trigger for grid fields if they are under fire. | |
void | SP_trigger_touch (edict_t *ent) |
Touch trigger to call the use function of the attached target. | |
void | SP_trigger_rescue (edict_t *ent) |
Rescue trigger to mark an actor to be in the rescue zone. Aborting a game would not kill the actors inside this trigger area. | |
void | SP_func_rotating (edict_t *ent) |
Spawns a rotating solid inline brush model. | |
void | SP_func_door (edict_t *ent) |
func_door (0 .5 .8) ? "health" if set, door is destroyable | |
void | SP_func_breakable (edict_t *ent) |
func_breakable (0.3 0.3 0.3) ? Used for breakable objects. | |
edict_t * | G_EdictsInit (void) |
Allocate space for the entity pointers. | |
void | G_EdictsReset (void) |
Reset the entity pointers for eg. a new game. | |
edict_t * | G_EdictsGetNewEdict (void) |
Find an entity that is not in use. | |
int | G_EdictsGetNumber (const edict_t *ent) |
Get an entity's ID number. | |
qboolean | G_EdictsIsValidNum (const int idx) |
Check if the given number could point to an existing entity. | |
edict_t * | G_EdictsGetByNum (const int num) |
Get an entity by it's number. | |
edict_t * | G_EdictsGetFirst (void) |
Returns the first entity. | |
edict_t * | G_EdictsGetNext (edict_t *lastEnt) |
Iterate through the list of entities. | |
edict_t * | G_EdictsGetNextInUse (edict_t *lastEnt) |
Iterate through the entities that are in use. | |
edict_t * | G_EdictsGetNextActor (edict_t *lastEnt) |
Iterate through the actor entities (even the dead! - but skips the invisible). | |
edict_t * | G_EdictsGetNextLivingActor (edict_t *lastEnt) |
Iterate through the living actor entities. | |
edict_t * | G_EdictsGetNextLivingActorOfTeam (edict_t *lastEnt, const int team) |
Iterate through the living actor entities of the given team. | |
void | G_EdictCalcOrigin (edict_t *ent) |
Calculate the edict's origin vector from it's grid position. | |
void | G_EdictSetOrigin (edict_t *ent, const pos3_t newPos) |
Set the edict's pos and origin vector to the given grid position. | |
qboolean | G_EdictPosIsSameAs (edict_t *ent, const pos3_t cmpPos) |
Set the edict's pos and origin vector to the given grid position. | |
Variables | |
game_locals_t | game |
level_locals_t | level |
game_import_t | gi |
game_export_t | globals |
cvar_t * | sv_maxentities |
cvar_t * | password |
cvar_t * | sv_needpass |
cvar_t * | sv_dedicated |
cvar_t * | logstats |
FILE * | logstatsfile |
cvar_t * | sv_filterban |
cvar_t * | sv_maxvelocity |
cvar_t * | sv_maxclients |
cvar_t * | sv_shot_origin |
cvar_t * | sv_hurtaliens |
cvar_t * | sv_maxplayersperteam |
cvar_t * | sv_maxsoldiersperteam |
cvar_t * | sv_maxsoldiersperplayer |
cvar_t * | sv_enablemorale |
cvar_t * | sv_roundtimelimit |
cvar_t * | sv_maxteams |
cvar_t * | sv_ai |
cvar_t * | sv_teamplay |
cvar_t * | ai_alien |
cvar_t * | ai_civilian |
cvar_t * | ai_equipment |
cvar_t * | ai_numaliens |
cvar_t * | ai_numcivilians |
cvar_t * | ai_numactors |
cvar_t * | mob_death |
cvar_t * | mob_wound |
cvar_t * | mof_watching |
cvar_t * | mof_teamkill |
cvar_t * | mof_civilian |
cvar_t * | mof_enemy |
cvar_t * | mor_pain |
cvar_t * | mor_default |
cvar_t * | mor_distance |
cvar_t * | mor_victim |
cvar_t * | mor_attacker |
cvar_t * | mon_teamfactor |
cvar_t * | mor_regeneration |
cvar_t * | mor_shaken |
cvar_t * | mor_panic |
cvar_t * | mor_brave |
cvar_t * | m_sanity |
cvar_t * | m_rage |
cvar_t * | m_rage_stop |
cvar_t * | m_panic_stop |
cvar_t * | g_reaction_fair |
cvar_t * | g_ailua |
cvar_t * | g_aidebug |
cvar_t * | g_drawtraces |
cvar_t * | g_nodamage |
cvar_t * | g_notu |
cvar_t * | g_nospawn |
cvar_t * | g_actorspeed |
cvar_t * | flood_msgs |
cvar_t * | flood_persecond |
cvar_t * | flood_waitdelay |
cvar_t * | difficulty |
edict_t * | ai_waypointList |
Local definitions for game module.
Definition in file g_local.h.
#define _ | ( | String | ) | String |
#define ACTOR_VIS_0 0.0 |
Definition at line 85 of file g_local.h.
Referenced by AI_CheckUsingDoor(), AI_SearchBestTarget(), AI_SearchDestroyableObject(), G_ActorVis(), and G_Vis().
#define ACTOR_VIS_10 0.1 |
Definition at line 84 of file g_local.h.
Referenced by G_ActorVis().
#define ACTOR_VIS_100 1.0 |
Actor visibility constants
Definition at line 82 of file g_local.h.
Referenced by G_ActorVis(), and G_Vis().
#define ACTOR_VIS_50 0.5 |
Definition at line 83 of file g_local.h.
Referenced by AI_CheckCrouch(), and G_ActorVis().
#define CONTAINER | ( | e, | |||
containerID | ) | ((e)->chr.i.c[(containerID)]) |
#define EXTENSION | ( | e | ) | (CONTAINER(e, gi.csi->idExtension)) |
#define FFL_NOSPAWN 2 |
Definition at line 303 of file g_local.h.
Referenced by ED_ParseField().
#define FFL_SPAWNTEMP 1 |
Definition at line 302 of file g_local.h.
Referenced by ED_ParseField().
#define FL_DESTROYABLE 0x00000004 |
If an edict is destroyable (like ET_BREAKABLE, ET_DOOR [if health set] or maybe a ET_MISSION [if health set]).
Definition at line 619 of file g_local.h.
Referenced by G_ClientGetFreeSpawnPointForActorSize(), G_MissionThink(), SP_func_breakable(), SP_func_door(), SP_func_rotating(), and SP_misc_mission().
#define FL_GROUPSLAVE 0x00000008 |
not the first on the team
Definition at line 612 of file g_local.h.
Referenced by G_ClientAction(), G_FindEdictGroups(), G_UseEdict(), and Touch_DoorTrigger().
#define FL_TRIGGERED 0x00000100 |
#define G_FreeTags | ( | tag | ) | gi.FreeTags((tag), __FILE__, __LINE__) |
Definition at line 87 of file g_local.h.
Referenced by G_FreeAllInventory(), G_Shutdown(), and G_SpawnEntities().
Definition at line 182 of file g_local.h.
Referenced by G_EdictsGetNextActor(), G_IsLivingActor(), G_MatchSendResults(), G_ShootGrenade(), G_ShootSingle(), G_SplashDamage(), G_TakeDamage(), G_UpdateShotMock(), Message_Use(), and Touch_Breakable().
#define G_IsAI | ( | ent | ) | (G_PLAYER_FROM_ENT((ent))->pers.ai) |
Definition at line 187 of file g_local.h.
Referenced by G_BuildForbiddenList(), G_MatchSendResults(), G_ReactionFireSetDefault(), and Touch_DoorTrigger().
#define G_IsAIPlayer | ( | player | ) | ((player)->pers.ai) |
Definition at line 188 of file g_local.h.
Referenced by AI_Run(), G_ClientEndRound(), G_ClientPrintf(), G_ClientShoot(), and G_SetTeamForPlayer().
#define G_IsAlien | ( | ent | ) | ((ent)->team == TEAM_ALIEN) |
Definition at line 193 of file g_local.h.
Referenced by AI_CivilianCalcBestAction(), G_Damage(), G_MissionTouch(), and G_ReactionFireShoot().
#define G_IsBlockingMovementActor | ( | ent | ) | (((ent)->type == ET_ACTOR && !G_IsDead(ent)) || ent->type == ET_ACTOR2x2) |
Definition at line 194 of file g_local.h.
Referenced by G_ActorFall(), G_ActorShouldStopInMidMove(), and G_BuildForbiddenList().
#define G_IsBreakable | ( | ent | ) | ((ent)->flags & FL_DESTROYABLE) |
Definition at line 183 of file g_local.h.
Referenced by AI_SearchDestroyableObject(), G_ActorFall(), G_EventShoot(), G_ShootSingle(), G_SplashDamage(), and G_TakeDamage().
Definition at line 184 of file g_local.h.
Referenced by G_Damage(), and G_SplashDamage().
#define G_IsCivilian | ( | ent | ) | ((ent)->team == TEAM_CIVILIAN) |
Definition at line 192 of file g_local.h.
Referenced by AI_CheckCrouch(), AI_FighterCalcBestAction(), AI_GetHidingTeam(), AI_HideNeeded(), AI_PrepBestAction(), AI_SearchBestTarget(), G_Morale(), G_ReactionFireIsPossible(), G_ShootSingle(), G_UpdateShotMock(), G_Vis(), and G_VisShouldStop().
#define G_IsCrouched | ( | ent | ) | G_IsState(ent, STATE_CROUCHED) |
Definition at line 179 of file g_local.h.
Referenced by AI_CheckForMissionTargets(), AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AI_FindHerdLocation(), AI_FindHidingLocation(), AI_PrepBestAction(), AI_TurnIntoDirection(), AIL_crouch(), AIL_positionshoot(), G_ActorSetMaxs(), G_ActorVis(), G_ClientMove(), G_PhysicsStep(), G_ShootSingle(), G_TeamPointVis(), G_Vis(), and pos3L_goto().
#define G_IsDazed | ( | ent | ) | G_IsState(ent, STATE_DAZED) |
Definition at line 178 of file g_local.h.
Referenced by G_ActorGiveTimeUnits(), G_ClientMove(), and G_ReactionFireIsPossible().
#define G_IsDead | ( | ent | ) | G_IsState(ent, STATE_DEAD) |
Definition at line 181 of file g_local.h.
Referenced by AI_ActorThink(), AI_PrepBestAction(), G_ActionCheck(), G_ActorSetMaxs(), G_ActorVis(), G_ClientMove(), G_ClientShoot(), G_IsLivingActor(), G_Morale(), G_MoraleBehaviour(), G_ReactionFireIsPossible(), G_ShootGrenade(), G_ShootSingle(), G_UpdateShotMock(), G_Vis(), Touch_HurtTrigger(), Touch_RescueTrigger(), and Touch_TouchTrigger().
#define G_IsInsane | ( | ent | ) | G_IsState(ent, STATE_INSANE) |
Definition at line 177 of file g_local.h.
Referenced by AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AI_FighterCheckShoot(), AI_SearchBestTarget(), and G_ReactionFireShoot().
#define G_IsPaniced | ( | ent | ) | G_IsState(ent, STATE_PANIC) |
Definition at line 174 of file g_local.h.
Referenced by AI_ActorThink(), AI_CivilianCalcBestAction(), AI_PrepBestAction(), G_MoraleBehaviour(), G_ReactionFireShoot(), and G_Vis().
#define G_IsRaged | ( | ent | ) | G_IsState(ent, STATE_RAGE) |
Definition at line 176 of file g_local.h.
Referenced by AI_FighterCalcBestAction(), G_MoraleBehaviour(), and G_ReactionFireShoot().
#define G_IsReaction | ( | ent | ) | G_IsState(ent, STATE_REACTION) |
Definition at line 175 of file g_local.h.
Referenced by AI_SearchBestTarget(), AIL_reactionfire(), and G_ClientStateChange().
#define G_IsShaken | ( | ent | ) | G_IsState(ent, STATE_SHAKEN) |
Definition at line 172 of file g_local.h.
Referenced by G_ClientStateChange(), G_ReactionFireIsPossible(), and G_ReactionFireShoot().
#define G_IsStunned | ( | ent | ) | (G_IsState(ent, STATE_STUN) & ~STATE_DEAD) |
Definition at line 173 of file g_local.h.
Referenced by G_ActionCheck(), G_ActorCheckRevitalise(), G_ActorRevitalise(), G_Damage(), G_IsLivingActor(), G_MatchEndCheck(), and Touch_HurtTrigger().
#define G_IsVisibleForTeam | ( | ent, | |||
team | ) | ((ent)->visflags & G_TeamToVisMask(team)) |
Definition at line 190 of file g_local.h.
Referenced by AI_CivilianCalcBestAction(), AI_HideNeeded(), G_ActorShouldStopInMidMove(), G_ClientShoot(), G_ReactionFireIsPossible(), G_SendInvisible(), G_TestVis(), and G_UpdateShotMock().
#define G_IsVisibleOnBattlefield | ( | ent | ) | (G_IsActor((ent)) || (ent)->type == ET_ITEM || (ent)->type == ET_PARTICLE) |
Definition at line 186 of file g_local.h.
Referenced by G_AppearPerishEvent(), and G_Vis().
#define G_MemFree | ( | ptr | ) | gi.TagFree((ptr), __FILE__, __LINE__) |
Definition at line 89 of file g_local.h.
Referenced by G_FreeInventory().
#define G_PLAYER_FROM_ENT | ( | ent | ) | (game.players + (ent)->pnum) |
Definition at line 91 of file g_local.h.
Referenced by G_ActorInvMove(), G_ActorSetInRescueZone(), G_ActorUseDoor(), G_Damage(), G_EventActorSendReservations(), G_EventReactionFireChange(), G_EventResetClientAction(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_ReactionFireCanBeEnabled(), G_ReactionFireGetTUsForItem(), G_ReactionFireTryToShoot(), G_ReactionFireUpdate(), G_ThinkActorGoCrouch(), and Message_Use().
#define G_PlayerToPM | ( | player | ) | ((player)->num < game.sv_maxplayersperteam ? 1 << ((player)->num) : 0) |
Definition at line 61 of file g_local.h.
Referenced by G_CheckVisPlayer(), G_ClientBegin(), G_ClientConnect(), G_ClientSendEdictsAndBrushModels(), G_ClientSpawn(), G_EventActorSendReservations(), G_EventReactionFireChange(), G_EventResetClientAction(), and G_SendInvisible().
#define G_RemoveCrouched | ( | ent | ) | G_RemoveState((ent), STATE_CROUCHED) |
Definition at line 217 of file g_local.h.
Referenced by G_MoralePanic().
#define G_RemoveDazed | ( | ent | ) | G_RemoveState((ent), STATE_DAZED) |
Definition at line 211 of file g_local.h.
Referenced by G_ActorGiveTimeUnits().
#define G_RemoveDead | ( | ent | ) | G_RemoveState((ent), STATE_DEAD) |
#define G_RemoveInsane | ( | ent | ) | G_RemoveState((ent), STATE_INSANE) |
Definition at line 214 of file g_local.h.
Referenced by G_MoraleStopRage().
#define G_RemovePanic | ( | ent | ) | G_RemoveState((ent), STATE_PANIC) |
Definition at line 216 of file g_local.h.
Referenced by G_MoraleStopPanic().
#define G_RemoveRage | ( | ent | ) | G_RemoveState((ent), STATE_RAGE) |
#define G_RemoveReaction | ( | ent | ) | G_RemoveState((ent), STATE_REACTION) |
Definition at line 218 of file g_local.h.
Referenced by G_ClientStateChange(), and G_Damage().
#define G_RemoveShaken | ( | ent | ) | G_RemoveState((ent), STATE_SHAKEN) |
Definition at line 210 of file g_local.h.
Referenced by G_ReactionFireReset(), and G_ReactionFireTryToShoot().
#define G_RemoveStunned | ( | ent | ) | G_RemoveState((ent), STATE_STUN) |
Definition at line 212 of file g_local.h.
Referenced by G_ActorDie(), and G_ActorRevitalise().
#define G_SetCrouched | ( | ent | ) | G_SetState((ent), STATE_CROUCHED) |
#define G_SetDazed | ( | ent | ) | G_SetState((ent), STATE_DAZED) |
Definition at line 201 of file g_local.h.
Referenced by G_Damage().
#define G_SetDead | ( | ent | ) | G_SetState((ent), STATE_DEAD) |
Definition at line 203 of file g_local.h.
Referenced by Touch_HurtTrigger().
#define G_SetInsane | ( | ent | ) | G_SetState((ent), STATE_INSANE) |
Definition at line 204 of file g_local.h.
Referenced by G_MoraleRage().
#define G_SetPanic | ( | ent | ) | G_SetState((ent), STATE_PANIC) |
Definition at line 206 of file g_local.h.
Referenced by G_MoralePanic().
#define G_SetRage | ( | ent | ) | G_SetState((ent), STATE_RAGE) |
Definition at line 205 of file g_local.h.
Referenced by G_MoraleRage().
#define G_SetShaken | ( | ent | ) | G_SetState((ent), STATE_SHAKEN) |
Definition at line 200 of file g_local.h.
Referenced by G_MoraleBehaviour().
#define G_SetState | ( | ent, | |||
s | ) | (ent)->state |= (s) |
Definition at line 199 of file g_local.h.
Referenced by G_ActorDie(), G_ClientStateChange(), and G_MoraleBehaviour().
#define G_SetStunned | ( | ent | ) | G_SetState((ent), STATE_STUN) |
Definition at line 202 of file g_local.h.
Referenced by Touch_HurtTrigger().
Definition at line 88 of file g_local.h.
Referenced by ED_NewString(), G_AllocInventoryMemory(), G_BuildForbiddenListForEntity(), G_EdictsInit(), and G_Init().
#define G_TeamToVisMask | ( | team | ) | (1 << (team)) |
Definition at line 189 of file g_local.h.
Referenced by G_BuildForbiddenList(), G_ClearVisFlags(), G_ClientShoot(), G_DoTestVis(), G_ShootSingle(), and G_VisToPM().
#define G_ToggleCrouched | ( | ent | ) | G_ToggleState(ent, STATE_CROUCHED) |
Definition at line 197 of file g_local.h.
Referenced by G_ClientStateChange().
#define GAME_INCLUDE |
#define GAMEVERSION "baseufo" |
#define INVDEF | ( | containerID | ) | (&gi.csi->ids[(containerID)]) |
#define MAX_DVTAB 32 |
Definition at line 417 of file g_local.h.
Referenced by G_ClientMove().
#define MAX_SPOT_DIST 4096 |
Definition at line 50 of file g_local.h.
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), G_ReactionFireIsPossible(), and G_Vis().
#define MORALE_RANDOM | ( | mod | ) | ( (mod) * (1.0 + 0.3*crand()) ) |
Definition at line 415 of file g_local.h.
Referenced by G_Morale(), and G_MoraleBehaviour().
#define ngettext | ( | x, | |||
y, | |||||
cnt | ) | x |
Definition at line 39 of file g_local.h.
Referenced by B_CheckBuildingStatusForMenu_f(), B_DrawBuilding(), B_SellOrAddItems(), BaseSummary_Init(), CP_NationHandleBudget(), GAME_CP_CampaignListClick_f(), INS_ParseInstallations(), INS_SelectInstallation(), TR_TransferAliensFromMission_f(), UI_BaseMapNodeDraw(), and UP_BuildingDescription().
#define PM_ALL 0xFFFFFFFF |
Bitmask for all players
Definition at line 55 of file g_local.h.
Referenced by Destroy_Breakable(), Door_Use(), G_ClientEndRound(), G_EventDestroyEdict(), G_EventEndRound(), G_EventSendEdict(), G_EventSpawnSound(), G_MatchSendResults(), G_MissionThink(), and G_TraceDraw().
#define random | ( | ) | ((rand() & 0x7fff) / ((float)0x7fff)) |
Definition at line 168 of file g_local.h.
Referenced by Com_GetActorSound(), SP_alien_start(), and SV_GetTileFromTileSet().
#define SERVER_FRAME_SECONDS 0.1 |
server is running at 10 fps
Definition at line 64 of file g_local.h.
Referenced by G_PhysicsStep(), G_PhysicsThink(), and G_RunFrame().
#define TAG_GAME 765 |
memory tags to allow dynamic memory to be cleaned up
Definition at line 67 of file g_local.h.
Referenced by G_EdictsInit(), G_Init(), and G_Shutdown().
#define TAG_LEVEL 766 |
Definition at line 68 of file g_local.h.
Referenced by ED_NewString(), G_BuildForbiddenListForEntity(), G_Shutdown(), and G_SpawnEntities().
#define TEAM_ALL 0xFFFFFFFF |
Bitmask for all teams
Definition at line 59 of file g_local.h.
Referenced by AIL_Init(), AIL_positionhide(), AIL_see(), and G_BuildForbiddenList().
#define VIS_APPEAR 1 |
Definition at line 398 of file g_local.h.
Referenced by G_ActorShouldStopInMidMove(), and G_DoTestVis().
#define VIS_CHANGE 1 |
the visibile changed - if it was visible - it's (the edict) now invisible
Definition at line 402 of file g_local.h.
Referenced by G_DoTestVis().
#define VIS_PERISH 2 |
Definition at line 399 of file g_local.h.
Referenced by G_DoTestVis().
#define VIS_STOP 4 |
stop the current action if actor appears
Definition at line 406 of file g_local.h.
Referenced by G_ActorDoTurn(), G_ActorShouldStopInMidMove(), G_ClientMove(), and G_DoTestVis().
#define VIS_YES 2 |
actor visible?
Definition at line 404 of file g_local.h.
Referenced by AI_FighterCalcBestAction(), AI_FindHidingLocation(), G_DoTestVis(), and G_TestVis().
#define VT_NOFRUSTUM 2 |
don't perform a frustum vis check via G_FrustumVis in G_Vis
Definition at line 413 of file g_local.h.
Referenced by AI_FighterCalcBestAction(), AI_FindHidingLocation(), AI_HideNeeded(), AIL_see(), and G_Vis().
#define VT_PERISH 1 |
check whether edict is still visible - it maybe is currently visible but this might have changed due to some action
Definition at line 411 of file g_local.h.
Referenced by AI_FighterCalcBestAction(), AI_FindHidingLocation(), G_DoTestVis(), and G_TestVis().
enum edictMaterial_t |
The think function for the ai controlled aliens.
[in] | player | |
[in] | ent |
Definition at line 964 of file g_ai.c.
References AI_CheckCrouch(), AI_PrepBestAction(), AI_TryToReloadWeapon(), AI_TurnIntoDirection(), game_import_t::csi, aiAction_t::fd, fireDef_s::fdIdx, G_ClientGetWeaponFromInventory(), G_ClientMove(), G_ClientShoot(), G_ClientStateChange(), G_IsDead, G_IsPaniced, gi, edict_s::hiding, csi_s::idLeft, csi_s::idRight, LEFT, edict_s::pos, qfalse, qtrue, RIGHT, aiAction_t::shootType, aiAction_t::shots, STATE_CROUCHED, aiAction_t::stop, aiAction_t::target, edict_s::team, and aiAction_t::z_align.
Referenced by AI_Run(), G_MoralePanic(), and G_MoraleRage().
Checks whether the AI controlled actor wants to use a door.
[in] | ent | The AI controlled actor |
[in] | door | The door edict |
Definition at line 99 of file g_ai.c.
References ACTOR_VIS_0, check, edict_s::doorState, frand(), G_ActorVis(), G_EdictsGetNextLivingActor(), G_FrustumVis(), gi, edict_s::hiding, MAX_SPOT_DIST, edict_s::origin, qfalse, qtrue, STATE_OPENED, edict_s::team, TEAM_ALIEN, TEAM_CIVILIAN, edict_s::type, and VectorDist.
Referenced by Touch_DoorTrigger().
player_t* AI_CreatePlayer | ( | int | team | ) |
Spawn civilians and aliens.
[in] | team |
Definition at line 1209 of file g_ai.c.
References client_persistant_t::ai, ai_numactors, ai_numaliens, ai_numcivilians, G_SetTeamForPlayer(), G_SpawnAIPlayer(), game, gi, i, cvar_s::integer, player_s::inuse, player_s::num, player_s::pers, game_locals_t::players, qtrue, sv_ai, sv_maxclients, game_locals_t::sv_maxplayersperteam, client_persistant_t::team, and TEAM_CIVILIAN.
Referenced by G_SpawnEntities(), and SVCmd_AI_Add_f().
void AI_Run | ( | void | ) |
Every server frame one single actor is handled - always in the same order.
Definition at line 1031 of file g_ai.c.
References level_locals_t::activeTeam, AI_ActorThink(), AIL_ActorThink(), level_locals_t::framenum, g_ailua, G_ClientEndRound(), G_EdictsGetNextLivingActorOfTeam(), G_IsAIPlayer, game, i, cvar_s::integer, player_s::inuse, client_persistant_t::last, level, player_s::pers, game_locals_t::players, game_locals_t::sv_maxplayersperteam, client_persistant_t::team, and edict_s::TU.
Referenced by G_RunFrame().
Checks whether the requested action is possible for the current active team.
[in] | player | Which player (human player) is trying to do the action |
[in] | ent | Which of his units is trying to do the action. |
[in] | TU | The time units to check against the ones ent has. the action with |
Definition at line 352 of file g_client.c.
References _, level_locals_t::activeTeam, G_ActionCheck(), G_ClientPrintf(), level, player_s::pers, PRINT_HUD, qfalse, qtrue, and client_persistant_t::team.
Referenced by G_ActorInvMove(), G_ClientMove(), G_ClientShoot(), G_ClientStateChange(), G_ClientTurn(), and G_ClientUseEdict().
Checks whether the requested action is possible.
[in] | player | Which player (human player) is trying to do the action |
[in] | ent | Which of his units is trying to do the action. |
[in] | TU | The time units to check against the ones ent has. the action with |
Definition at line 375 of file g_client.c.
References G_ActionCheck().
Referenced by G_ClientShoot().
void G_ActorCheckRevitalise | ( | edict_t * | ent | ) |
Definition at line 327 of file g_actor.c.
References G_ActorRevitalise(), G_EventActorRevitalise(), G_IsStunned, G_SendStats(), edict_s::HP, and edict_s::STUN.
Referenced by G_Damage(), and G_UpdateStunState().
Reports and handles death or stun of an actor. If the HP of an actor is zero the actor will die, otherwise the actor will get stunned.
[in] | ent | Pointer to an entity being killed or stunned actor. |
[in] | attacker | Pointer to attacker - it must be notified about state of victim. |
Definition at line 353 of file g_actor.c.
References FLOOR, G_ActorDie(), G_ActorStun(), G_CheckVis(), G_CheckVisTeamAll(), G_EventActorDie(), G_InventoryToFloor(), edict_s::HP, level, level_locals_t::num_alive, qfalse, qtrue, and edict_s::team.
Referenced by G_ClientMove(), G_Damage(), G_MatchSendResults(), and G_ThinkActorDieAfterSpawn().
Turns an actor around.
[in] | ent | the actor (edict) we are talking about |
[in] | dir | the direction to turn the edict into, might be an action |
Definition at line 191 of file g_actor.c.
References byte, CORE_DIRECTIONS, edict_s::dir, directionAngles, dvleft, dvright, FLYING_DIRECTIONS, G_CheckVisTeamAll(), G_EventActorTurn(), i, PATHFINDING_DIRECTIONS, qfalse, edict_s::team, and VIS_STOP.
Referenced by AI_TurnIntoDirection(), G_ClientMove(), and G_ClientTurn().
void G_ActorFall | ( | edict_t * | ent | ) |
Let an actor fall down if e.g. the func_breakable the actor was standing on was destroyed.
[in,out] | ent | The actor that should fall down |
Definition at line 137 of file g_move.c.
References ET_NULL, FALLING_DAMAGE_FACTOR, edict_s::fieldSize, G_CheckVis(), G_EdictCalcOrigin(), G_EventActorFall(), G_GetEdictFromPos(), G_IsBlockingMovementActor, G_IsBreakable, G_TakeDamage(), gi, edict_s::pos, qtrue, and game_import_t::routingMap.
Referenced by Touch_Breakable().
edict_t* G_ActorGetByUCN | ( | const int | ucn, | |
const int | team | |||
) |
Searches an actor by a unique character number.
[in] | ucn | The unique character number |
[in] | team | The team to get the actor with the ucn from |
NULL
Definition at line 173 of file g_actor.c.
References edict_s::chr, G_EdictsGetNextActor(), edict_s::team, and character_s::ucn.
Referenced by G_ClientInitActorStates().
int G_ActorGetReservedTUs | ( | const edict_t * | ent | ) |
Calculates the amount of all currently reserved TUs.
ent | The actor to calculate the reserved TUs for |
Definition at line 108 of file g_actor.c.
References edict_s::chr, chrReservations_s::crouch, chrReservations_s::reaction, character_s::reservedTus, and chrReservations_s::shot.
Referenced by G_ActorInvMove(), and G_ActorUsableTUs().
int G_ActorGetTUForReactionFire | ( | const edict_t * | ent | ) |
Calculates the amount of TUs that are needed for the current selected reaction fire mode.
[in] | ent | The actors edict |
Definition at line 134 of file g_actor.c.
References ACTOR_GET_INV, edict_s::chr, FIRESH_FiredefForWeapon(), chrFiremodeSettings_s::fmIdx, chrFiremodeSettings_s::hand, invList_s::item, character_s::RFmode, item_s::t, and fireDef_s::time.
Referenced by G_ActorHasEnoughTUsReactionFire(), and G_ClientStateChange().
void G_ActorGiveTimeUnits | ( | edict_t * | ent | ) |
Set time units for the given edict. Based on speed skills.
ent | The actor edict |
Definition at line 283 of file g_actor.c.
References ABILITY_SPEED, edict_s::chr, G_ActorSetTU(), G_IsDazed, G_RemoveDazed, GET_TU, character_s::score, and chrScoreGlobal_s::skills.
Referenced by AI_SetStats(), and G_GiveTimeUnits().
void G_ActorInvMove | ( | edict_t * | ent, | |
const invDef_t * | from, | |||
invList_t * | fItem, | |||
const invDef_t * | to, | |||
int | tx, | |||
int | ty, | |||
qboolean | checkaction | |||
) |
Moves an item inside an inventory. Floors are handled special.
[in] | ent | The pointer to the selected/used edict/soldier. |
[in] | from | The container (-id) the item should be moved from. |
[in] | fItem | The item you want to move. |
[in] | to | The container (-id) the item should be moved to. |
[in] | tx | x position where you want the item to go in the destination container |
[in] | ty | y position where you want the item to go in the destination container |
[in] | checkaction | Set this to qtrue if you want to check for TUs, otherwise qfalse. |
Definition at line 393 of file g_actor.c.
References _, edict_s::chr, FLOOR, chrFiremodeSettings_s::fmIdx, G_ActionCheckForCurrentTeam(), G_ActorGetReservedTUs(), G_ActorSetTU(), G_ActorUseTU(), G_CheckVis(), G_ClientPrintf(), G_EventInventoryAdd(), G_EventInventoryDelete(), G_EventInventoryReload(), G_EventPerish(), G_FreeEdict(), G_GetFloorItems(), G_PLAYER_FROM_ENT, G_ReactionFireUpdate(), G_SendStats(), G_SpawnFloor(), G_TeamToPM(), G_VisToPM(), G_WriteItem(), game, gi, chrFiremodeSettings_s::hand, game_locals_t::i, character_s::i, IA_NONE, IA_NORELOAD, IA_NOTIME, IA_RELOAD, IA_RELOAD_SWAP, INV_IsFloorDef(), INV_IsLeftDef(), INV_IsRightDef(), INVSH_FindSpace(), INVSH_GetFirstShapePosition(), INVSH_SearchInInventory(), invList_s::item, inventoryInterface_s::MoveInInventory, NONE, edict_s::pos, PRINT_HUD, qfalse, qtrue, character_s::RFmode, item_s::t, edict_s::team, edict_s::TU, edict_s::visflags, chrFiremodeSettings_s::weapon, invList_s::x, and invList_s::y.
Referenced by AI_TryToReloadWeapon(), G_ActorReload(), G_ClientAction(), G_ClientGetWeaponFromInventory(), G_MissionTouch(), and G_MoralePanic().
Checks whether the given actor is currently standing in a rescue zone.
[in] | actor | The actor to check |
true
if the actor is standing in a rescue zone, false
otherwise. Definition at line 62 of file g_actor.c.
References edict_s::inRescueZone.
Referenced by G_ActorSetInRescueZone(), and G_MatchSendResults().
Reload weapon with actor.
[in] | ent | Pointer to an actor reloading weapon. |
[in] | invDef | Reloading weapon in right or left hand. |
Definition at line 567 of file g_actor.c.
References CONTAINER, game_import_t::csi, G_ActorInvMove(), gi, invDef_s::id, csi_s::idRight, INV_IsLeftDef(), INVDEF, INVSH_LoadableInWeapon(), invList_s::item, invList_s::next, csi_s::numIDs, invDef_s::out, qtrue, RIGHT, and item_s::t.
Referenced by AI_TryToReloadWeapon(), and AIL_reload().
void G_ActorReserveTUs | ( | edict_t * | ent, | |
int | resReaction, | |||
int | resShot, | |||
int | resCrouch | |||
) |
Reserves TUs for different actor actions.
[in,out] | ent | The actor to reserve TUs for. Might not be NULL . |
[in] | resReaction | TUs for reaction fire |
[in] | resShot | TUs for shooting |
[in] | resCrouch | TUs for going into crouch mode |
Definition at line 156 of file g_actor.c.
References edict_s::chr, chrReservations_s::crouch, G_EventActorSendReservations(), chrReservations_s::reaction, character_s::reservedTus, chrReservations_s::shot, and edict_s::TU.
Referenced by G_ClientAction(), G_ClientStateChange(), and G_Damage().
Handles the client actions (interaction with the world).
actor | The actors' edict | |
ent | The edict that can be used by the actor |
Definition at line 90 of file g_actor.c.
References edict_s::clientAction, G_EventResetClientAction(), and G_EventSetClientAction().
Referenced by Reset_DoorTrigger(), and Touch_DoorTrigger().
Set the rescue zone data.
[out] | actor | The actor to set the rescue zone flag for |
[in] | inRescueZone | true if the actor is in the rescue zone, false otherwise |
Definition at line 72 of file g_actor.c.
References _, G_ActorIsInRescueZone(), G_ClientPrintf(), G_PLAYER_FROM_ENT, edict_s::inRescueZone, and PRINT_HUD.
Referenced by Reset_RescueTrigger(), and Touch_RescueTrigger().
void G_ActorSetMaxs | ( | edict_t * | ent | ) |
Sets correct bounding box for actor (state dependent).
[in] | ent | Pointer to entity for which bounding box is being set. |
Definition at line 266 of file g_actor.c.
References G_IsCrouched, G_IsDead, gi, edict_s::maxs, PLAYER_CROUCH, PLAYER_DEAD, PLAYER_STAND, PLAYER_WIDTH, and VectorSet.
Referenced by G_ActorDie(), G_ActorRevitalise(), G_ClientStateChange(), G_MoraleBehaviour(), and G_MoralePanic().
void G_ActorSetTU | ( | edict_t * | ent, | |
int | tus | |||
) |
Definition at line 290 of file g_actor.c.
References edict_s::TU.
Referenced by G_ActorGiveTimeUnits(), G_ActorInvMove(), G_ActorUseTU(), G_ClientInitActorStates(), G_ClientMove(), G_ClientShoot(), G_Damage(), G_MoralePanic(), and SP_func_door().
int G_ActorUsableTUs | ( | const edict_t * | ent | ) |
Calculates the amount of usable TUs. This is without the reserved TUs.
[in] | ent | The actor to calculate the amount of usable TUs for. If ent is NULL , we return zero here |
Definition at line 120 of file g_actor.c.
References G_ActorGetReservedTUs(), and edict_s::TU.
Referenced by G_ActionCheck().
Make the actor use (as in open/close) a door edict.
actor | The actor that is using the door | |
door | The door that should be opened/closed |
Definition at line 44 of file g_actor.c.
References ET_ACTOR, G_ClientUseEdict(), G_FindRadius(), G_PLAYER_FROM_ENT, G_TouchTriggers(), edict_s::origin, and UNIT_SIZE.
Referenced by G_ClientAction(), and Touch_DoorTrigger().
void G_ActorUseTU | ( | edict_t * | ent, | |
int | tus | |||
) |
Definition at line 295 of file g_actor.c.
References G_ActorSetTU(), and edict_s::TU.
Referenced by G_ActorInvMove(), G_ClientStateChange(), G_ClientTurn(), and G_ClientUseEdict().
calculate how much check is "visible" from from
[in] | from | The world coordinate to check from |
[in] | check | The edict to check how good (or if at all) it is visible |
[in] | full | Perform a full check in different directions. If this is false the actor is fully visible if one vis check returned true . With true this function can also return a value != 0.0 and != 1.0. Try to only use true if you really need the full check. Full checks are of course more expensive. |
Definition at line 63 of file g_vis.c.
References ACTOR_VIS_0, ACTOR_VIS_10, ACTOR_VIS_100, ACTOR_VIS_50, G_IsCrouched, G_IsDead, G_LineVis(), i, edict_s::origin, PLAYER_CROUCH, PLAYER_DEAD, PLAYER_MIN, PLAYER_STAND, VectorCopy, VectorMA(), and VectorNormalize().
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_SearchBestTarget(), AI_SearchDestroyableObject(), AIL_positionshoot(), G_Morale(), G_ReactionFireIsPossible(), G_SplashDamage(), and G_Vis().
Adds a new item to an existing or new floor container edict at the given grid location.
pos | The grid location to spawn the item on the floor | |
itemID | The item to spawn |
Definition at line 125 of file g_inventory.c.
References edict_s::chr, game_import_t::csi, G_GetFloorItemsFromPos(), G_SpawnFloor(), game, gi, character_s::i, game_locals_t::i, csi_s::idFloor, INVDEF, INVSH_GetItemByIDSilent(), NONE_AMMO, qfalse, item_s::t, and inventoryInterface_s::TryAddToInventory.
Referenced by SP_misc_item().
void G_AddToWayPointList | ( | edict_t * | ent | ) |
Definition at line 904 of file g_ai.c.
References edict_s::groupChain, and i.
Referenced by SP_civilian_target().
void G_AppearPerishEvent | ( | unsigned int | playerMask, | |
qboolean | appear, | |||
edict_t * | check, | |||
const edict_t * | ent | |||
) |
Send the appear or perish event to the affected clients.
[in] | playerMask | These are the affected players or clients In case of e.g. teamplay there can be more than one client affected - thus this is a player mask |
[in] | appear | Is this event about an appearing actor (or a perishing one) |
[in] | check | The edict we are talking about (that appears or perishes) |
[in] | ent | The edict that was responsible for letting the check edict appear or perish. Might be NULL . |
Definition at line 159 of file g_client.c.
References ABILITY_MIND, ABILITY_SPEED, edict_s::body, edict_s::chr, edict_s::dir, ET_ACTOR, ET_ACTOR2x2, ET_ITEM, ET_PARTICLE, EV_ACTOR_APPEAR, EV_ACTOR_STATECHANGE, EV_ENT_PERISH, edict_s::fieldSize, G_EdictAppear(), G_IsVisibleOnBattlefield, G_SendInventory(), G_SendParticle(), G_TeamToPM(), character_s::gender, GET_MORALE, GET_TU, gi, edict_s::head, teamDef_s::idx, LEFT, MAX_SKILL, character_s::maxHP, NONE, edict_s::number, edict_s::pnum, edict_s::pos, RIGHT, character_s::score, chrScoreGlobal_s::skills, character_s::skin, SKIP_LOCAL_ENTITY, edict_s::state, STATE_PUBLIC, edict_s::team, character_s::teamDef, edict_s::type, and edict_s::visflags.
Referenced by G_DoTestVis(), G_MatchSendResults(), G_MissionThink(), and G_SplashDamage().
void G_CenterView | ( | const edict_t * | ent | ) |
Centers the view for all clients that are seeing the given edict on the world position of the edict.
ent | The edict to use the position from |
Definition at line 239 of file g_client.c.
References EV_CENTERVIEW, G_VisToPM(), gi, edict_s::pos, and edict_s::visflags.
Referenced by G_MoralePanic().
void G_CheckForceEndRound | ( | void | ) |
Check whether a forced round end should be executed.
Definition at line 30 of file g_round.c.
References _, level_locals_t::activeTeam, level_locals_t::framenum, G_ClientEndRound(), game, gi, i, cvar_s::integer, player_s::inuse, level, level_locals_t::nextEndRound, player_s::pers, game_locals_t::players, PRINT_HUD, level_locals_t::roundstartTime, sv_maxclients, game_locals_t::sv_maxplayersperteam, sv_roundtimelimit, client_persistant_t::team, and level_locals_t::time.
Referenced by G_RunFrame().
Check if the edict appears/perishes for the other teams. If they appear for other teams, the needed information for those clients are also send in G_CheckVisTeam
resp. G_AppearPerishEvent
.
[in] | perish | Also check for perishing events |
[in] | check | The edict that is maybe seen by others. If NULL, all edicts are checked |
Definition at line 334 of file g_vis.c.
References G_CheckVisTeam(), G_CheckVisTeamAll(), level, MAX_TEAMS, and level_locals_t::num_alive.
Referenced by Door_Use(), G_ActorDieOrStun(), G_ActorFall(), G_ActorInvMove(), G_ActorRevitalise(), G_ClientMove(), G_ClientStateChangeUpdate(), G_Damage(), G_InventoryToFloor(), G_SpawnAIPlayer(), G_SpawnItemOnFloor(), and G_SpawnParticle().
Sets visible edict on player spawn.
Definition at line 261 of file g_vis.c.
References G_DoTestVis(), G_EdictsGetNextInUse(), G_PlayerToPM, player_s::pers, and client_persistant_t::team.
Referenced by G_ClientSpawn().
Checks whether an edict appear/perishes for a specific team - also updates the visflags each edict carries.
[in] | team | Team to check the vis for |
[in] | check | The edict that you want to check (and which maybe will appear or perish for the given team). If this is NULL every edict will be checked. |
[in] | perish | Also check whether the edict (the actor) is going to become invisible for the given team |
[in] | ent | The edict that is (maybe) seeing other edicts |
G_AppearPerishEvent
Definition at line 298 of file g_vis.c.
References G_DoTestVis(), G_TeamToPM(), and edict_s::inuse.
Referenced by Destroy_Breakable(), G_CheckVis(), and G_CheckVisTeamAll().
Do G_CheckVisTeam
for all entities.
Definition at line 314 of file g_vis.c.
References G_CheckVisTeam(), and G_EdictsGetNextInUse().
Referenced by Door_Use(), G_ActorDieOrStun(), G_ActorDoTurn(), G_ActorRevitalise(), G_CheckVis(), G_ClientEndRound(), G_ClientMove(), G_ClientShoot(), G_ClientStateChangeUpdate(), and G_Damage().
void G_ClearVisFlags | ( | int | team | ) |
Reset the visflags for all edicts in the global list for the given team - and only for the given team.
Definition at line 355 of file g_vis.c.
References G_EdictsGetNextInUse(), G_TeamToVisMask, and edict_s::visflags.
Referenced by G_ClientSpawn(), and G_SpawnAIPlayer().
int G_ClientAction | ( | player_t * | player | ) |
The client sent us a message that he did something. We now execute the related fucntion(s) adn notify him if neccessary.
[in] | player | The player to execute the action for (the actor belongs to this player) |
Definition at line 610 of file g_client.c.
References byte, edict_s::chr, edict_s::clientAction, game_import_t::csi, FL_GROUPSLAVE, edict_s::flags, format, G_ActorInvMove(), G_ActorReserveTUs(), G_ActorUseDoor(), G_ClientMove(), G_ClientShoot(), G_ClientStateChange(), G_ClientTurn(), G_EdictsGetByNum(), G_ReactionFireUpdate(), gi, edict_s::groupMaster, character_s::i, i, INVDEF, INVSH_GetItemByIDX(), INVSH_SearchInInventory(), edict_s::number, csi_s::numIDs, pa_format, PA_INVMOVE, PA_MOVE, PA_NULL, PA_REACT_SELECT, PA_RESERVE_STATE, PA_SHOOT, PA_STATE, PA_TURN, PA_USE_DOOR, player_s::pers, pos, qtrue, chrReservations_s::reaction, character_s::reservedTus, client_persistant_t::team, and edict_s::type.
Referenced by GetGameAPI().
This functions starts the client.
Definition at line 1235 of file g_client.c.
References player_s::began, CS_PLAYERCOUNT, CS_PLAYERNAMES, EV_START, EVENT_INSTANTLY, G_ClientSendEdictsAndBrushModels(), G_GetTeam(), G_PlayerToPM, gi, cvar_s::integer, level, client_persistant_t::netname, player_s::num, level_locals_t::numplayers, player_s::pers, PRINT_CONSOLE, qfalse, qtrue, sv_teamplay, and client_persistant_t::team.
Referenced by GetGameAPI().
qboolean G_ClientCanReload | ( | edict_t * | ent, | |
containerIndex_t | containerID | |||
) |
Returns true if actor can reload weapon.
Definition at line 502 of file g_client.c.
References CONTAINER, game_import_t::csi, gi, csi_s::idLeft, csi_s::idRight, INVSH_LoadableInWeapon(), invList_s::item, invList_s::next, csi_s::numIDs, qfalse, qtrue, RIGHT, and item_s::t.
Referenced by AI_TryToReloadWeapon(), and AIL_canreload().
void G_ClientCommand | ( | player_t * | player | ) |
Definition at line 391 of file g_cmds.c.
References game_import_t::Cmd_Argv(), G_Players_f(), G_Say_f(), gi, player_s::inuse, Q_strcasecmp, qfalse, and qtrue.
Referenced by GetGameAPI().
Checks whether the connection is valid or invalid and set some user info keys.
[in,out] | player | The player that is trying to connect to the game |
[in,out] | userinfo | The userinfo data that is checked and changed |
[in] | userinfoSize | The size of the userinfo buffer |
false
if the connection is refused, true
otherwise Definition at line 1359 of file g_client.c.
References Com_Printf(), G_ClientDisconnect(), G_ClientUserinfoChanged(), G_PlayerToPM, gi, Info_SetValueForKey(), Info_ValueForKey(), player_s::inuse, client_persistant_t::netname, password, player_s::pers, PRINT_CONSOLE, qfalse, qtrue, REJ_BANNED, REJ_PASSWORD_REQUIRED_OR_INCORRECT, cvar_s::string, and SV_FilterPacket().
Referenced by GetGameAPI().
void G_ClientDisconnect | ( | player_t * | player | ) |
Definition at line 1401 of file g_client.c.
References level_locals_t::activeTeam, player_s::began, CS_PLAYERCOUNT, G_ActorDie(), G_ClientEndRound(), G_EdictsGetNextLivingActor(), G_MatchEndCheck(), gi, player_s::isReady, level, client_persistant_t::netname, player_s::num, level_locals_t::numplayers, player_s::pers, edict_s::pnum, PRINT_CONSOLE, qfalse, player_s::roundDone, STATE_DEAD, and client_persistant_t::team.
Referenced by G_ClientConnect(), G_GetTeam(), and GetGameAPI().
void G_ClientEndRound | ( | player_t * | player | ) |
Definition at line 145 of file g_round.c.
References level_locals_t::activeTeam, level_locals_t::actualRound, EV_ENDROUNDANNOUNCE, EVENT_INSTANTLY, level_locals_t::framenum, G_CheckVisTeamAll(), G_EventEndRound(), G_GetNextActiveTeam(), G_GetPlayerForTeam(), G_GiveTimeUnits(), G_IsAIPlayer, G_MatchIsRunning(), G_MoraleBehaviour(), G_PlayerSoldiersCount(), G_ReactionFireEndTurn(), G_ReactionFireReset(), G_UpdateStunState(), game, gi, i, cvar_s::integer, player_s::inuse, level, mor_panic, level_locals_t::nextEndRound, player_s::num, player_s::pers, game_locals_t::players, PM_ALL, qfalse, qtrue, player_s::roundDone, level_locals_t::roundstartTime, game_locals_t::sv_maxplayersperteam, sv_teamplay, client_persistant_t::team, and level_locals_t::time.
Referenced by AI_Run(), G_CheckForceEndRound(), G_ClientDisconnect(), and GetGameAPI().
edict_t* G_ClientGetFreeSpawnPointForActorSize | ( | const player_t * | player, | |
const actorSizeEnum_t | actorSize | |||
) |
Searches a free spawning point for a given actor size.
[in] | player | The player to get the free spawn points for |
[in] | actorSize | The actor size to get a spawning point for |
NULL
if no free spawning point was found Definition at line 974 of file g_client.c.
References ACTOR_SIZE_2x2, ACTOR_SIZE_NORMAL, edict_s::chr, ET_ACTOR, ET_ACTOR2x2, ET_ACTOR2x2SPAWN, ET_ACTORSPAWN, edict_s::fieldSize, character_s::fieldSize, FL_DESTROYABLE, edict_s::flags, G_ClientGetFreeSpawnPoint(), G_ThinkActorDieAfterSpawn(), G_ThinkActorGoCrouch(), G_TouchTriggers(), gi, edict_s::HP, level, edict_s::morale, edict_s::nextthink, player_s::num, level_locals_t::num_alive, level_locals_t::num_spawned, edict_s::pnum, edict_s::spawnflags, STATE_CROUCHED, STATE_DEAD, STATE_STUN, edict_s::team, edict_s::think, and edict_s::type.
Referenced by G_ClientTeamInfo(), and G_SpawnAIPlayer().
int G_ClientGetTeamNum | ( | const player_t * | player | ) |
Returns the assigned team number of the player.
Definition at line 831 of file g_client.c.
References player_s::pers, and client_persistant_t::team.
Referenced by GetGameAPI().
int G_ClientGetTeamNumPref | ( | const player_t * | player | ) |
Returns the preferred team number for the player.
Definition at line 840 of file g_client.c.
References Info_ValueForKey(), player_s::pers, and client_persistant_t::userinfo.
Referenced by G_GetTeam(), and GetGameAPI().
void G_ClientGetWeaponFromInventory | ( | edict_t * | ent | ) |
Retrieve or collect weapon from any linked container for the actor.
Definition at line 533 of file g_client.c.
References item_s::a, edict_s::chr, CONTAINER, game_import_t::csi, G_ActorInvMove(), gi, csi_s::idRight, INVDEF, invList_s::item, invList_s::next, csi_s::numIDs, invDef_s::out, qtrue, objDef_s::reload, item_s::t, character_s::teamDef, objDef_s::weapon, and teamDef_s::weapons.
Referenced by AI_ActorThink().
void G_ClientInitActorStates | ( | const player_t * | player | ) |
This is called after the actors are spawned and will set actor states without consuming TUs.
player | The player to perform the action for |
Definition at line 1133 of file g_client.c.
References G_ActorGetByUCN(), G_ActorSetTU(), G_ClientStateChange(), G_ClientStateChangeUpdate(), gi, i, player_s::pers, qfalse, client_persistant_t::team, and edict_s::TU.
Referenced by GetGameAPI().
true
if the player is for starting the multiplayer match Definition at line 849 of file g_client.c.
References player_s::isReady.
Referenced by GetGameAPI().
Generates the client events that are send over the netchannel to move an actor.
[in] | player | Player who is moving an actor |
[in] | visTeam | The team to check the visibility for - if this is 0 we build the forbidden list above all edicts - for the human controlled actors this would mean that clicking to a grid position that is not reachable because an invisible actor is standing there would not result in a single step - as the movement is aborted before. For AI movement this is in general 0 - but not if they e.g. hide. |
[in] | ent | Edict to move |
[in] | to | The grid position to walk to |
Definition at line 207 of file g_move.c.
References ACTOR_SPEED_CROUCHED, ACTOR_SPEED_NORMAL, player_s::autostand, byte, edict_s::chr, edict_s::clientAction, moveinfo_t::contentFlags, CORE_DIRECTIONS, moveinfo_t::currentStep, edict_s::dir, EV_ACTOR_MOVE, FLOOR, G_ActionCheckForCurrentTeam(), G_ActorDieOrStun(), G_ActorDoTurn(), G_ActorSetTU(), G_ActorShouldStopInMidMove(), g_actorspeed, G_CheckVis(), G_CheckVisTeamAll(), G_ClientStateChange(), G_EdictCalcOrigin(), G_EventActorTurn(), G_GetFloorItems(), G_IsCrouched, G_IsDazed, G_IsDead, G_MoveCalc(), g_notu, G_PhysicsStep(), G_PrintActorStats(), G_ReactionFireOnMovement(), G_SendStats(), G_TouchTriggers(), G_VisToPM(), getDVdir, gi, cvar_s::integer, lengthof, level, MAX_DVTAB, chrScoreMission_s::movedCrouched, chrScoreMission_s::movedNormal, edict_s::moveinfo, NewDVZ, edict_s::nextthink, edict_s::number, edict_s::origin, level_locals_t::pathingMap, PLAYER_MIN, edict_s::pos, pos, PosAddDV, PosSubDV, qfalse, qtrue, ROUTING_NOT_REACHABLE, ROUTING_UNREACHABLE, character_s::scoreMission, SHOULD_USE_AUTOSTAND, edict_s::speed, edict_s::state, STATE_CROUCHED, moveinfo_t::steps, edict_s::team, edict_s::think, level_locals_t::time, edict_s::TU, TU_CROUCH_MOVING_FACTOR, TU_MOVE_STRAIGHT, TU_TURN, cvar_s::value, VectorCompare, VectorCopy, VIS_STOP, moveinfo_t::visflags, edict_s::visflags, and game_import_t::WriteDummyByte().
Referenced by AI_ActorThink(), AI_PrepBestAction(), G_ClientAction(), and pos3L_goto().
void G_ClientPrintf | ( | const player_t * | player, | |
int | printlevel, | |||
const char * | fmt, | |||
... | ||||
) |
qboolean G_ClientShoot | ( | const player_t * | player, | |
edict_t * | ent, | |||
const pos3_t | at, | |||
shoot_types_t | shootType, | |||
fireDefIndex_t | firemode, | |||
shot_mock_t * | mock, | |||
qboolean | allowReaction, | |||
int | z_align | |||
) |
Setup for shooting, either real or mock.
[in] | player | The player this action belongs to (i.e. either the ai or the player) |
[in] | ent | the edict that is doing the shot |
[in] | at | Position to fire on. |
[in] | shootType | What type of shot this is (left, right reaction-left etc...). |
[in] | firemode | The firemode index of the ammo for the used weapon. |
[in] | mock | pseudo shooting - only for calculating mock values - NULL for real shots |
[in] | allowReaction | Set to qtrue to check whether this has forced any reaction fire, otherwise qfalse. |
[in] | z_align | This value may change the target z height - often GROUND_DELTA is used to calculate the alignment. This can be used for splash damage weapons. It's often useful to target the ground close to the victim. That way you don't need a 100 percent chance to hit your target. Even if you don't hit it, the splash damage might reduce the health of your target. |
Reset status.
Reset status.
If loaded ammo is less than needed ammo from firedef then reduce shot-number relative to the difference.
< State info so we can check if an item was already removed.
Definition at line 1064 of file g_combat.c.
References _, item_s::a, fireDef_s::ammo, AngleToDir(), edict_s::chr, CORE_DIRECTIONS, objDef_s::deplete, edict_s::dir, inventoryInterface_s::EmptyContainer, edict_s::fieldSize, chrScoreMission_s::fired, chrScoreMission_s::firedHit, chrScoreMission_s::firedSplash, chrScoreMission_s::firedSplashHit, chrScoreMission_s::firedSplashTUs, chrScoreMission_s::firedTUs, objDef_s::fireTwoHanded, G_ActionCheckForCurrentTeam(), G_ActionCheckWithoutTeam(), G_ActorSetTU(), G_CheckVisTeamAll(), G_ClientPrintf(), G_EdictPosIsSameAs(), G_EventActorTurn(), G_EventInventoryAmmo(), G_EventInventoryDelete(), G_EventShootHidden(), G_EventStartShoot(), G_GetShotOrigin(), G_IsAIPlayer, G_IsDead, G_IsVisibleForTeam, G_MatchEndCheck(), G_PrepareShot(), G_ReactionFirePostShot(), G_ReactionFirePreShot(), G_SendStats(), G_ShootGrenade(), G_ShootSingle(), G_TeamPointVis(), G_TeamToVisMask, G_VisToPM(), game, gi, fireDef_s::gravity, character_s::i, game_locals_t::i, edict_s::inuse, INVDEF, fireDef_s::irgoggles, IS_SHOT_REACTION, KILLED_NUM_TYPES, LEFT, item_s::m, MAX_TEAMS, objDef_s::oneshot, edict_s::origin, edict_s::pos, PRINT_HUD, qfalse, qtrue, fireDef_s::range, player_s::reactionLeftover, game_import_t::routingMap, character_s::scoreMission, fireDef_s::shots, invDef_s::single, fireDef_s::splrad, item_s::t, edict_s::team, objDef_s::thrown, fireDef_s::time, todeg, edict_s::TU, VectorDist, VectorMA(), VectorSubtract, edict_s::visflags, and fireDef_s::weaponSkill.
Referenced by actorL_shoot(), AI_ActorThink(), G_ClientAction(), and G_ReactionFireShoot().
void G_ClientSpawn | ( | player_t * | player | ) |
Sets the team, init the TU and sends the player stats.
Definition at line 1275 of file g_client.c.
References level_locals_t::activeTeam, EV_RESET, EVENT_INSTANTLY, G_CheckVisPlayer(), G_ClearVisFlags(), G_GetStartingTeam(), G_GiveTimeUnits(), G_PlayerToPM, G_SendInvisible(), G_SendPlayerStats(), gi, level, client_persistant_t::netname, player_s::pers, PRINT_CONSOLE, qfalse, and client_persistant_t::team.
Referenced by GetGameAPI().
void G_ClientStateChange | ( | const player_t * | player, | |
edict_t * | ent, | |||
int | reqState, | |||
qboolean | checkaction | |||
) |
Changes the state of a player/soldier.
[in,out] | player | The player who controlls the actor |
[in] | ent | the edict to perform the state change for |
[in] | reqState | The bit-map of the requested state change |
[in] | checkaction | only activate the events - network stuff is handled in the calling function don't even use the G_ActionCheckForCurrentTeam function |
Definition at line 442 of file g_client.c.
References _, edict_s::chr, chrReservations_s::crouch, G_ActionCheckForCurrentTeam(), G_ActorGetTUForReactionFire(), G_ActorReserveTUs(), G_ActorSetMaxs(), G_ActorUseTU(), G_ClientPrintf(), G_ClientStateChangeUpdate(), G_IsReaction, G_IsShaken, G_ReactionFireCanBeEnabled(), G_ReactionFireSetDefault(), G_RemoveReaction, G_SetState, G_ToggleCrouched, gi, PRINT_HUD, character_s::reservedTus, chrReservations_s::shot, STATE_CROUCHED, STATE_REACTION, STATE_REACTION_MANY, STATE_REACTION_ONCE, and TU_CROUCH.
Referenced by AI_ActorThink(), AI_InitPlayer(), AI_PrepBestAction(), AIL_crouch(), AIL_reactionfire(), G_ClientAction(), G_ClientInitActorStates(), G_ClientMove(), G_ReactionFireUpdate(), and G_ThinkActorGoCrouch().
void G_ClientTeamInfo | ( | const player_t * | player | ) |
The client lets the server spawn the actors for a given player by sending their information (models, inventory, etc..) over the network.
[in] | player | The player to spawn the actors for. |
Definition at line 1159 of file g_client.c.
References Com_DPrintf(), Com_Printf(), DEBUG_GAME, edict_s::fieldSize, G_ActorSpawnIsAllowed(), G_ClientAssignDefaultActorValues(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientReadCharacter(), G_ClientReadInventory(), G_ClientSkipActorInfo(), game, inventoryInterface_s::GetUsedSlots, gi, game_locals_t::i, i, client_persistant_t::netname, player_s::num, player_s::pers, edict_s::team, client_persistant_t::team, and TEAM_NO_ACTIVE.
Referenced by GetGameAPI().
This function 'uses' the edict. E.g. it opens the door when the player wants it to open.
[in] | player | The player is trying to activate the door |
[in,out] | actor | The actor the player is using to activate the entity |
[in,out] | edict | The entity that is to be used |
Definition at line 586 of file g_client.c.
References G_ActionCheckForCurrentTeam(), G_ActorUseTU(), G_SendStats(), G_UseEdict(), gi, qfalse, qtrue, and edict_s::TU.
Referenced by G_ActorUseDoor().
void G_ClientUserinfoChanged | ( | player_t * | player, | |
char * | userinfo | |||
) |
called whenever the player updates a userinfo variable.
Definition at line 1307 of file g_client.c.
References player_s::autostand, Com_DPrintf(), CS_PLAYERNAMES, DEBUG_GAME, G_GetTeam(), G_MatchIsRunning(), gi, Info_Validate(), Info_ValueForKey(), player_s::isReady, client_persistant_t::netname, player_s::num, player_s::pers, Q_strncpyz(), player_s::reactionLeftover, client_persistant_t::team, TEAM_NO_ACTIVE, and client_persistant_t::userinfo.
Referenced by G_ClientConnect(), and GetGameAPI().
void G_CompleteRecalcRouting | ( | void | ) |
Definition at line 446 of file g_utils.c.
References G_EdictsGetNextInUse(), G_RecalcRouting(), and IS_BMODEL.
Referenced by G_RunFrame().
void G_EdictCalcOrigin | ( | edict_t * | ent | ) |
Calculate the edict's origin vector from it's grid position.
Functions to handle single edicts, trying to encapsulate edict->pos in the first place.
ent | The entity |
Definition at line 218 of file g_edicts.c.
References edict_s::fieldSize, gi, edict_s::origin, edict_s::pos, and game_import_t::routingMap.
Referenced by AI_FindHerdLocation(), AI_FindHidingLocation(), G_Actor2x2Spawn(), G_ActorFall(), G_ActorSpawn(), G_ClientMove(), G_SpawnEntities(), G_SpawnFloor(), and SP_civilian_target().
Set the edict's pos and origin vector to the given grid position.
ent | The entity | |
newPos | The grid position to compare to |
Definition at line 240 of file g_edicts.c.
References edict_s::pos, and VectorCompare.
Referenced by G_ClientShoot(), and G_ShootSingle().
Set the edict's pos and origin vector to the given grid position.
ent | The entity | |
newPos | The new grid position |
Definition at line 228 of file g_edicts.c.
References edict_s::fieldSize, gi, edict_s::origin, edict_s::pos, game_import_t::routingMap, and VectorCopy.
Referenced by AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AIL_positionherd(), and AIL_positionhide().
edict_t* G_EdictsGetByNum | ( | const int | num | ) |
Get an entity by it's number.
[in] | num | The entity's index in the array of entities |
Definition at line 81 of file g_edicts.c.
References G_EdictsIsValidNum(), and gi.
Referenced by G_ClientAction().
edict_t* G_EdictsGetFirst | ( | void | ) |
Returns the first entity.
Definition at line 96 of file g_edicts.c.
Referenced by G_ClientSendEdictsAndBrushModels(), G_FindEdictGroups(), G_SendBoundingBoxes(), and G_SpawnEntities().
edict_t* G_EdictsGetNewEdict | ( | void | ) |
Find an entity that is not in use.
Definition at line 130 of file g_edicts.c.
References G_EdictsGetNext(), game, globals, edict_s::inuse, game_export_t::num_edicts, and game_locals_t::sv_maxentities.
Referenced by G_Spawn().
Iterate through the list of entities.
lastEnt | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 105 of file g_edicts.c.
References globals, and game_export_t::num_edicts.
Referenced by G_ClientGetFreeSpawnPoint(), G_EdictsGetNewEdict(), G_EdictsGetNextInUse(), and G_FindTargetEntity().
Iterate through the actor entities (even the dead! - but skips the invisible).
lastEnt | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 201 of file g_edicts.c.
References G_EdictsGetNextInUse(), G_IsActor, globals, and game_export_t::num_edicts.
Referenced by AIL_Cleanup(), G_ActorGetByUCN(), G_MatchSendResults(), G_SendInvisible(), and G_SendPlayerStats().
Iterate through the entities that are in use.
lastEnt | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 155 of file g_edicts.c.
References G_EdictsGetNext(), and edict_s::inuse.
Referenced by AI_CheckForMissionTargets(), AI_SearchDestroyableObject(), G_BuildForbiddenList(), G_CheckVisPlayer(), G_CheckVisTeamAll(), G_ClearVisFlags(), G_ClientSendEdictsAndBrushModels(), G_CompleteRecalcRouting(), G_EdictsGetNextActor(), G_EdictsGetNextLivingActor(), G_Find(), G_FindEdictGroups(), G_FindRadius(), G_GenerateEntList(), G_GetEdictFromPos(), G_MatchSendResults(), G_MissionThink(), G_Morale(), G_MoraleBehaviour(), G_PhysicsRun(), G_ResetTriggers(), G_SendBoundingBoxes(), G_SplashDamage(), and G_TestVis().
Iterate through the living actor entities.
lastEnt | The entity found in the previous iteration; if NULL, we start at the beginning |
Definition at line 170 of file g_edicts.c.
References G_EdictsGetNextInUse(), and G_IsLivingActor().
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AI_HideNeeded(), AIL_see(), G_ClientDisconnect(), G_EdictsGetNextLivingActorOfTeam(), G_MatchSendResults(), G_PlayerSoldiersCount(), G_ReactionFireCheckExecution(), G_ReactionFireEndTurn(), G_ReactionFirePreShot(), and G_ReactionFireSearchTarget().
Iterate through the living actor entities of the given team.
lastEnt | The entity found in the previous iteration; if NULL, we start at the beginning | |
team | The team we are looking for |
Definition at line 186 of file g_edicts.c.
References G_EdictsGetNextLivingActor(), and edict_s::team.
Referenced by AI_CheckFF(), AI_FindHerdLocation(), AI_Run(), G_GiveTimeUnits(), G_MatchEndCheck(), G_ReactionFireReset(), G_TeamPointVis(), and G_UpdateStunState().
int G_EdictsGetNumber | ( | const edict_t * | ent | ) |
Get an entity's ID number.
ent | The entity |
Definition at line 58 of file g_edicts.c.
References globals, and game_export_t::num_edicts.
Referenced by G_InitEdict().
edict_t* G_EdictsInit | ( | void | ) |
Allocate space for the entity pointers.
Functions handling the storage and lifecycle of all edicts
Definition at line 38 of file g_edicts.c.
References G_TagMalloc, game, game_locals_t::sv_maxentities, and TAG_GAME.
Referenced by G_Init().
qboolean G_EdictsIsValidNum | ( | const int | num | ) |
Check if the given number could point to an existing entity.
[in] | num | The entity's index in the array of entities |
Definition at line 70 of file g_edicts.c.
References globals, game_export_t::num_edicts, qfalse, and qtrue.
Referenced by G_EdictsGetByNum().
void G_EdictsReset | ( | void | ) |
Reset the entity pointers for eg. a new game.
Definition at line 47 of file g_edicts.c.
References game, and game_locals_t::sv_maxentities.
Referenced by G_SpawnEntities().
void G_EventActorDie | ( | const edict_t * | ent | ) |
Announce the actor die event for the clients that are seeing the actor.
[in] | ent | The actor that is dying |
Definition at line 57 of file g_events.c.
References EV_ACTOR_DIE, G_VisToPM(), gi, edict_s::number, edict_s::state, and edict_s::visflags.
Referenced by G_ActorDieOrStun().
void G_EventActorFall | ( | const edict_t * | ent | ) |
Definition at line 261 of file g_events.c.
References DIRECTION_FALL, EV_ACTOR_MOVE, G_VisToPM(), gi, GRAVITY, makeDV, edict_s::number, edict_s::pos, and edict_s::visflags.
Referenced by G_ActorFall().
void G_EventActorRevitalise | ( | const edict_t * | ent | ) |
Announce the actor die event for the clients that are seeing the actor.
[in] | ent | The actor that was healed and woke up again |
Definition at line 68 of file g_events.c.
References EV_ACTOR_REVITALISED, G_VisToPM(), gi, edict_s::number, edict_s::state, and edict_s::visflags.
Referenced by G_ActorCheckRevitalise().
void G_EventActorSendReservations | ( | const edict_t * | ent | ) |
Will inform the player about the real TU reservation.
ent | The actors edict. |
Definition at line 79 of file g_events.c.
References edict_s::chr, chrReservations_s::crouch, EV_ACTOR_RESERVATIONCHANGE, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, edict_s::number, chrReservations_s::reaction, character_s::reservedTus, and chrReservations_s::shot.
Referenced by G_ActorReserveTUs().
void G_EventActorStats | ( | const edict_t * | ent | ) |
Definition at line 301 of file g_events.c.
References EV_ACTOR_STATS, G_TeamToPM(), gi, edict_s::HP, edict_s::morale, edict_s::number, edict_s::STUN, edict_s::team, and edict_s::TU.
Referenced by G_SendStats().
void G_EventActorTurn | ( | const edict_t * | ent | ) |
Send the turn event for the given entity.
ent | The entity to send the turn event for |
Definition at line 46 of file g_events.c.
References edict_s::dir, EV_ACTOR_TURN, G_VisToPM(), gi, edict_s::number, and edict_s::visflags.
Referenced by G_ActorDoTurn(), G_ClientMove(), G_ClientShoot(), and G_ClientTurn().
void G_EventDestroyEdict | ( | const edict_t * | ent | ) |
Unregister an edict at the client.
ent | The edict to unregister |
Definition at line 136 of file g_events.c.
References EV_ENT_DESTROY, gi, edict_s::number, and PM_ALL.
Referenced by G_FreeEdict().
void G_EventEndRound | ( | void | ) |
End of round event for the current active team.
Definition at line 315 of file g_events.c.
References level_locals_t::activeTeam, EV_ENDROUND, gi, level, and PM_ALL.
Referenced by G_ClientEndRound().
void G_EventInventoryAdd | ( | const edict_t * | ent, | |
int | playerMask, | |||
int | itemAmount | |||
) |
Tell the client to add the item from the container.
[in] | ent | Pointer to entity having given inventory. |
[in] | playerMask | The player mask to determine which clients should receive the event (e.g. G_VisToPM (ent->visflags)) |
[in] | itemAmount | How many items to add. |
G_WriteItem
call Definition at line 115 of file g_events.c.
References EV_INV_ADD, gi, INV_INVENTORY_BYTES, and edict_s::number.
Referenced by G_ActorInvMove(), and G_SendInventory().
void G_EventInventoryAmmo | ( | const edict_t * | ent, | |
const objDef_t * | ammo, | |||
int | amount, | |||
shoot_types_t | shootType | |||
) |
Change the amount of available ammo for the given entity.
ent | The entity to change the amount of ammo for | |
ammo | The ammo to change | |
amount | The new amount of the left ammo | |
shootType | The shooting type to determine which container to use |
Definition at line 149 of file g_events.c.
References game_import_t::csi, EV_INV_AMMO, G_VisToPM(), gi, csi_s::idLeft, csi_s::idRight, objDef_s::idx, IS_SHOT_RIGHT, edict_s::number, and edict_s::visflags.
Referenced by G_ClientShoot().
void G_EventInventoryDelete | ( | const edict_t * | ent, | |
int | playerMask, | |||
const invDef_t * | invDef, | |||
int | x, | |||
int | y | |||
) |
Tell the client to remove the item from the container.
[in] | ent | Pointer to entity having given inventory. |
[in] | playerMask | The player mask to determine which clients should receive the event (e.g. G_VisToPM (ent->visflags)) |
[in] | invDef | Pointer to inventory definition having given container. |
[in] | x | Position of item in container. |
[in] | y | Position of item in container. |
Definition at line 99 of file g_events.c.
References EV_INV_DEL, gi, invDef_s::id, and edict_s::number.
Referenced by G_ActorInvMove(), G_ClientShoot(), and G_InventoryRemoveItemByID().
void G_EventInventoryReload | ( | const edict_t * | ent, | |
int | playerMask, | |||
const item_t * | item, | |||
const invDef_t * | invDef, | |||
const invList_t * | ic | |||
) |
Definition at line 321 of file g_events.c.
References objDef_s::ammo, EV_INV_RELOAD, gi, invDef_s::id, objDef_s::idx, item_s::m, edict_s::number, item_s::t, invList_s::x, and invList_s::y.
Referenced by G_ActorInvMove().
void G_EventParticleSpawn | ( | int | playerMask, | |
const char * | name, | |||
int | levelFlags, | |||
const vec3_t | s, | |||
const vec3_t | v, | |||
const vec3_t | a | |||
) |
Spawn a new particle for the client.
[in] | name | The id of the particle (see ptl_*.ufo script files in base/ufos) |
[in] | levelFlags | Show at which levels |
[in] | s | starting/location vector |
[in] | v | velocity vector |
[in] | a | acceleration vector |
Definition at line 251 of file g_events.c.
References EV_PARTICLE_SPAWN, and gi.
Referenced by G_TraceDraw().
void G_EventPerish | ( | const edict_t * | ent | ) |
Send an event to all clients that are seeing the given edict, that it just has disappeared.
ent | The edict that disappeared |
Definition at line 126 of file g_events.c.
References EV_ENT_PERISH, G_VisToPM(), gi, edict_s::number, and edict_s::visflags.
Referenced by Destroy_Breakable(), G_ActorInvMove(), G_InventoryToFloor(), and G_SpawnItemOnFloor().
void G_EventReactionFireChange | ( | const edict_t * | ent | ) |
Definition at line 229 of file g_events.c.
References edict_s::chr, EV_ACTOR_REACTIONFIRECHANGE, chrFiremodeSettings_s::fmIdx, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, chrFiremodeSettings_s::hand, objDef_s::idx, NONE, edict_s::number, character_s::RFmode, and chrFiremodeSettings_s::weapon.
Referenced by G_ReactionFireSetDefault(), and G_ReactionFireUpdate().
void G_EventResetClientAction | ( | const edict_t * | ent | ) |
Reset the client actions for the given entity.
[in] | ent | The entity to reset the client action for |
Definition at line 295 of file g_events.c.
References EV_RESET_CLIENT_ACTION, G_PLAYER_FROM_ENT, G_PlayerToPM, gi, and edict_s::number.
Referenced by G_ActorSetClientAction().
void G_EventSendEdict | ( | const edict_t * | ent | ) |
Send the bounding box info to the client.
[in] | ent | The edict to send the bounding box for |
Definition at line 356 of file g_events.c.
References edict_s::absmax, edict_s::absmin, EV_ADD_EDICT, gi, edict_s::number, PM_ALL, and edict_s::type.
Referenced by G_SendBoundingBoxes().
void G_EventSetClientAction | ( | const edict_t * | ent | ) |
Informs the client that an interaction with the world is possible.
[in] | ent | The edict that can execute the action (an actor) |
Definition at line 279 of file g_events.c.
References edict_s::clientAction, EV_DOOR_ACTION, G_TeamToPM(), gi, edict_s::number, and edict_s::team.
Referenced by G_ActorSetClientAction().
void G_EventShoot | ( | const edict_t * | ent, | |
int | visMask, | |||
const fireDef_t * | fd, | |||
qboolean | firstShoot, | |||
shoot_types_t | shootType, | |||
int | flags, | |||
const trace_t * | trace, | |||
const vec3_t | from, | |||
const vec3_t | impact | |||
) |
Do the shooting.
ent | The entity that is doing the shooting | |
visMask | the vis mask to determine the clients from this event is send to | |
fd | The firedefinition to use for the shoot | |
firstShoot | Is this the first shoot | |
shootType | The type of the shoot | |
flags | Define some flags in a bitmask: SF_BODY , SF_IMPACT , SF_BOUNCING and SF_BOUNCING | |
trace | The trace what was used to determine whether this shot has hit something | |
from | The position the entity shoots from | |
impact | The impact world vector for the shot |
Definition at line 207 of file g_events.c.
References trace_s::contentFlags, trace_s::ent, EV_ACTOR_SHOOT, fireDef_s::fdIdx, G_IsBreakable, G_VisToPM(), gi, objDef_s::idx, edict_s::number, fireDef_s::obj, trace_s::plane, SKIP_LOCAL_ENTITY, and fireDef_s::weapFdsIdx.
Referenced by G_ShootSingle().
Start the shooting event for hidden actors.
visMask | the vis mask to determine the clients from this event is send to | |
fd | The firedefinition to use for the shoot | |
firstShoot | Is this the first shoot |
Definition at line 186 of file g_events.c.
References EV_ACTOR_SHOOT_HIDDEN, fireDef_s::fdIdx, G_VisToPM(), gi, objDef_s::idx, fireDef_s::obj, and fireDef_s::weapFdsIdx.
Referenced by G_ClientShoot(), and G_ShootSingle().
Spawns a sound for all connected clients (that will be spatialized on the client side).
ent | The edict that is causing the sound | |
origin | The origin of the sound | |
sound | The sound file, path relative to sounds/. If there is a + at the end of the path, a random sound will be taken. |
Definition at line 35 of file g_events.c.
Referenced by Destroy_Breakable(), and Door_Use().
void G_EventStartShoot | ( | const edict_t * | ent, | |
int | visMask, | |||
shoot_types_t | shootType, | |||
const pos3_t | at | |||
) |
Start the shooting event.
ent | The entity that starts the shooting | |
visMask | the vis mask of the teams to determine the clients from this event is send to | |
shootType | The type of the shoot | |
at | The grid position to target to |
Definition at line 171 of file g_events.c.
References EV_ACTOR_START_SHOOT, G_VisToPM(), gi, edict_s::number, and edict_s::pos.
Referenced by G_ClientShoot().
void G_EventThrow | ( | int | visMask, | |
const fireDef_t * | fd, | |||
float | dt, | |||
byte | flags, | |||
const vec3_t | position, | |||
const vec3_t | velocity | |||
) |
[in] | visMask | the vis mask to determine the clients from this event is send to |
[in] | fd | The firedefinition to use |
[in] | dt | Delta time |
[in] | flags | bitmask of the following values: SF_BODY , SF_IMPACT , SF_BOUNCING and SF_BOUNCED |
[in] | position | The current position |
[in] | velocity | The velocity of the throw |
Definition at line 340 of file g_events.c.
References EV_ACTOR_THROW, fireDef_s::fdIdx, G_VisToPM(), gi, objDef_s::idx, fireDef_s::obj, and fireDef_s::weapFdsIdx.
Referenced by G_ShootGrenade().
Searches all active entities for the next one that holds the matching string at fieldofs (use the offsetof() macro) in the structure.
[in] | from | If this is NULL all edicts will be searched, otherwise the given edict will be the start of the search |
[in] | fieldofs | The field offset of the struct member (returned by the offsetof macro) of the field to search the given value for |
[in] | match | The value of the field |
while ((spot = G_Find(spot, FOFS(classname), "misc_whatever")) != NULL) { [..] }
Definition at line 344 of file g_utils.c.
References byte, G_EdictsGetNextInUse(), and Q_strcasecmp.
edict_t* G_FindRadius | ( | edict_t * | from, | |
const vec3_t | org, | |||
float | rad, | |||
entity_type_t | type | |||
) |
Returns entities that have origins within a spherical area.
[in] | from | The entity to start the search from. NULL will start from the beginning. |
[in] | org | The origin that is the center of the circle. |
[in] | rad | radius to search an edict in. |
[in] | type | Type of entity. ET_NULL to ignore the type.
edict_t* ent = NULL; while ((ent = G_FindRadius(ent, origin, rad, type)) != NULL) { [...] } |
Definition at line 391 of file g_utils.c.
References ET_NULL, G_EdictsGetNextInUse(), edict_s::maxs, edict_s::mins, edict_s::origin, edict_s::type, and VectorLength().
Referenced by G_ActorUseDoor().
edict_t* G_FindTargetEntity | ( | const char * | target | ) |
Searches the edict that has the given target as targetname
set.
target | The target name of the edict that you are searching |
NULL
if no edict with the given target name was found, otherwise the edict that has the targetname set you were looking for. Definition at line 365 of file g_utils.c.
References G_EdictsGetNext(), and edict_s::targetname.
Referenced by G_MissionUse(), and Touch_TouchTrigger().
void G_FreeEdict | ( | edict_t * | ent | ) |
Marks the edict as free.
Definition at line 36 of file g_utils.c.
References edict_s::classname, G_EventDestroyEdict(), gi, edict_s::inuse, and qfalse.
Referenced by Destroy_Breakable(), G_ActorInvMove(), G_MissionThink(), G_MissionUse(), G_SpawnItemOnFloor(), Message_Use(), SP_2x2_start(), SP_alien_start(), SP_civilian_start(), SP_dummy(), SP_human_start(), SP_light(), SP_misc_item(), SP_misc_message(), SP_misc_mission(), SP_misc_model(), SP_player_start(), SP_trigger_touch(), and Touch_TouchTrigger().
Checks whether a point is "visible" from the edicts position.
Definition at line 31 of file g_vis.c.
References edict_s::dir, FrustumVis(), and edict_s::origin.
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), G_Morale(), G_ReactionFireIsPossible(), G_SplashDamage(), G_TeamPointVis(), and G_Vis().
void G_GenerateEntList | ( | const char * | entList[MAX_EDICTS] | ) |
creates an entity list
[out] | entList | A list of all active inline model entities |
Definition at line 418 of file g_utils.c.
References G_EdictsGetNextInUse(), i, IS_BMODEL, and edict_s::model.
Referenced by G_RecalcRouting(), and G_TestLineWithEnts().
int G_GetActiveTeam | ( | void | ) |
Returns the current active team to the server.
TEAM_NO_ACTIVE
there is either noDefinition at line 288 of file g_client.c.
References level_locals_t::activeTeam, and level.
Referenced by G_GetNextActiveTeam(), and GetGameAPI().
Searches an actor on the given grid position.
pos | The position to search an actor on |
NULL
if no actor is standing on that grid position Definition at line 121 of file g_move.c.
References ET_ACTOR, ET_ACTOR2x2, ET_ACTORHIDDEN, and G_GetEdictFromPos().
Referenced by G_SpawnItemOnFloor().
edict_t* G_GetEdictFromPos | ( | const pos3_t | pos, | |
const entity_type_t | type | |||
) |
Searches an edict of the given type at the given grid location.
pos | The grid location to look for an edict. | |
type | The type of the edict to look for or -1 to look for any type in the search. |
NULL
if nothing was found, otherwise the entity located at the given grid position. Definition at line 54 of file g_utils.c.
References ET_NULL, G_EdictsGetNextInUse(), edict_s::pos, edict_s::type, and VectorCompare.
Referenced by G_ActorFall(), G_ActorShouldStopInMidMove(), G_GetActorFromPos(), G_GetFloorItemsFromPos(), and G_MissionThink().
Prepares a list of items on the floor at given entity position.
[in] | ent | Pointer to an entity being an actor. |
NULL
in case no items were found on the edict grid position. Definition at line 43 of file g_inventory.c.
References FLOOR, G_GetFloorItemsFromPos(), and edict_s::pos.
Referenced by G_ActorInvMove(), G_ActorRevitalise(), G_ClientMove(), G_InventoryToFloor(), G_MissionThink(), and G_SpawnItemOnFloor().
Callback to G_GetEdictFromPos() for given position, used to get items from position.
[in] | pos | A position for which items are wanted. |
Definition at line 32 of file g_inventory.c.
References ET_ITEM, and G_GetEdictFromPos().
Referenced by G_AddItemToFloor(), G_GetFloorItems(), and G_SpawnItemOnFloor().
player_t* G_GetPlayerForTeam | ( | int | team | ) |
Gets player for given team.
[in] | team | The team the player data should be searched for |
NULL
when no player found. Definition at line 147 of file g_utils.c.
References game, i, player_s::inuse, player_s::pers, game_locals_t::players, game_locals_t::sv_maxplayersperteam, and client_persistant_t::team.
Referenced by G_ClientEndRound().
const char* G_GetPlayerName | ( | int | pnum | ) |
Returns the player name for a give player number.
Definition at line 230 of file g_utils.c.
References game, client_persistant_t::netname, player_s::pers, game_locals_t::players, and game_locals_t::sv_maxplayersperteam.
Referenced by G_PrintActorStats(), and GetGameAPI().
const char* G_GetWeaponNameForFiredef | ( | const fireDef_t * | fd | ) |
Returns the corresponding weapon name for a given fire definition.
[in] | fd | Pointer to fire definition, for which item is wanted. |
Definition at line 133 of file g_utils.c.
References G_GetObjectForFiredef(), and objDef_s::id.
Referenced by G_PrintActorStats().
void G_GiveTimeUnits | ( | int | team | ) |
Network function to update the time units (TUs) for each team-member.
[in] | team | The index of the team to update the values for. |
Definition at line 99 of file g_client.c.
References G_ActorGiveTimeUnits(), G_EdictsGetNextLivingActorOfTeam(), and G_SendStats().
Referenced by G_ClientEndRound(), and G_ClientSpawn().
qboolean G_InventoryRemoveItemByID | ( | const char * | itemID, | |
edict_t * | ent, | |||
containerIndex_t | container | |||
) |
Removes one particular item from a given container.
itemID | The id of the item to remove | |
ent | The edict that holds the inventory to remove the item from | |
container | The container in the inventory of the edict to remove the searched item from. |
true
if the removal was successful, false
otherwise. Definition at line 64 of file g_inventory.c.
References edict_s::chr, CONTAINER, G_EventInventoryDelete(), G_VisToPM(), game, gi, character_s::i, game_locals_t::i, objDef_s::id, INVDEF, invList_s::item, invList_s::next, qfalse, qtrue, inventoryInterface_s::RemoveFromInventory, item_s::t, edict_s::visflags, invList_s::x, and invList_s::y.
Referenced by G_MissionThink().
void G_InventoryToFloor | ( | edict_t * | ent | ) |
Move items to adjacent locations if the containers on the current floor edict are full.
Move the whole given inventory to the floor and destroy the items that do not fit there.
[in] | ent | Pointer to an edict_t being an actor. |
Definition at line 205 of file g_inventory.c.
References inventoryInterface_s::AddToInventory, item_s::amount, edict_s::chr, CONTAINER, game_import_t::csi, FLOOR, G_CheckVis(), G_EventPerish(), G_GetFloorItems(), G_InventoryDropToFloorCheck(), G_SpawnFloor(), game, gi, character_s::i, game_locals_t::i, objDef_s::id, csi_s::idArmour, csi_s::idFloor, INVDEF, invList_s::item, invList_s::next, next, NONE, edict_s::number, csi_s::numIDs, edict_s::pos, qtrue, inventoryInterface_s::RemoveFromInventory, item_s::t, and edict_s::visflags.
Referenced by G_ActorDieOrStun().
Checks whether the given edict is a living actor.
[in] | ent | The edict to perform the check for |
Definition at line 32 of file g_actor.c.
References G_IsActor, G_IsDead, and G_IsStunned.
Referenced by Door_Use(), G_Damage(), G_EdictsGetNextLivingActor(), G_ReactionFireCanBeEnabled(), G_SplashDamage(), G_TouchTriggers(), G_Vis(), and G_VisShouldStop().
qboolean G_MatchDoEnd | ( | void | ) |
Checks whether a match is over.
true
if this match is over, false
otherwise Definition at line 306 of file g_match.c.
References G_MatchSendResults(), G_PrintStats(), level_locals_t::intermissionTime, level, qfalse, qtrue, level_locals_t::time, va(), and level_locals_t::winningTeam.
Referenced by G_RunFrame().
void G_MatchEndCheck | ( | void | ) |
Checks whether there are still actors to fight with left. If non are the match end will be triggered.
Definition at line 325 of file g_match.c.
References level_locals_t::activeTeam, G_EdictsGetNextLivingActorOfTeam(), G_IsStunned, G_MatchEndTrigger(), i, level_locals_t::intermissionTime, level, MAX_TEAMS, level_locals_t::numplayers, and TEAM_ALIEN.
Referenced by G_ClientDisconnect(), and G_ClientShoot().
void G_MatchEndTrigger | ( | int | team, | |
int | timeGap | |||
) |
Triggers the end of the game. Will be executed in the next server (or game) frame.
[in] | team | The winning team |
[in] | timeGap | Second to wait before really ending the game. Useful if you want to allow a last view on the scene |
Definition at line 169 of file g_match.c.
References level_locals_t::intermissionTime, level, level_locals_t::time, and level_locals_t::winningTeam.
Referenced by G_MatchEndCheck(), G_MissionThink(), and SVCmd_Win_f().
qboolean G_MatchIsRunning | ( | void | ) |
Checks whether the game is running (active team and no intermission time).
Definition at line 366 of file g_match.c.
References level_locals_t::activeTeam, level_locals_t::intermissionTime, level, qfalse, and TEAM_NO_ACTIVE.
Referenced by Door_Use(), G_ClientEndRound(), G_ClientUserinfoChanged(), G_GetStartingTeam(), G_MissionThink(), G_PhysicsRun(), G_ReactionFireCanBeEnabled(), and G_RunFrame().
Mission trigger destroy function.
Definition at line 101 of file g_mission.c.
References qtrue.
Referenced by SP_misc_mission().
void G_MissionThink | ( | edict_t * | self | ) |
Definition at line 135 of file g_mission.c.
References level_locals_t::actualRound, edict_s::child, Com_Printf(), edict_s::count, game_import_t::csi, ET_ITEM, ET_MISSION, ET_PARTICLE, FL_DESTROYABLE, edict_s::flags, FLOOR, G_AppearPerishEvent(), G_EdictsGetNextInUse(), G_FreeEdict(), G_GetEdictFromPos(), G_GetFloorItems(), G_InventoryRemoveItemByID(), G_MatchEndTrigger(), G_MatchIsRunning(), G_SpawnParticle(), G_VisToPM(), gi, edict_s::groupChain, edict_s::groupMaster, edict_s::HP, objDef_s::id, csi_s::idFloor, invList_s::item, edict_s::item, level, invList_s::next, edict_s::number, edict_s::particle, PM_ALL, edict_s::pos, qfalse, item_s::t, edict_s::team, edict_s::time, edict_s::type, edict_s::use, and edict_s::visflags.
Referenced by SP_misc_mission(), and SP_misc_mission_aliens().
Mission trigger.
use level.nextmap to spawn another map when every living actor has touched the mission trigger
use level.actualRound to determine the 'King of the Hill' time
Definition at line 38 of file g_mission.c.
References _, level_locals_t::actualRound, CONTAINER, game_import_t::csi, G_ActorInvMove(), G_IsAlien, gi, objDef_s::id, csi_s::idFloor, INVDEF, invList_s::item, level, invList_s::next, NONE, csi_s::numIDs, PRINT_HUD, qfalse, qtrue, item_s::t, edict_s::team, TEAM_ALIEN, and invDef_s::temp.
Referenced by SP_misc_mission(), and SP_misc_mission_aliens().
Mission trigger use function.
Definition at line 109 of file g_mission.c.
References edict_s::destroy, G_FindTargetEntity(), G_FreeEdict(), gi, edict_s::HP, qfalse, qtrue, and edict_s::use.
Referenced by SP_misc_mission().
void G_MoraleBehaviour | ( | int | team | ) |
Applies morale behaviour on actors.
Definition at line 144 of file g_morale.c.
References _, ABILITY_MIND, level_locals_t::activeTeam, edict_s::chr, ET_ACTOR, frand(), G_ActorSetMaxs(), G_ClientPrintf(), G_EdictsGetNextInUse(), G_IsDead, G_IsMoraleEnabled(), G_IsPaniced, G_IsRaged, G_MoralePanic(), G_MoraleRage(), G_MoraleStopPanic(), G_MoraleStopRage(), G_PLAYER_FROM_ENT, G_SendState(), G_SendStats(), G_SetShaken, G_SetState, G_VisToPM(), GET_MORALE, gi, cvar_s::integer, level, m_rage, m_sanity, mor_panic, mor_regeneration, mor_shaken, edict_s::morale, MORALE_RANDOM, character_s::name, PRINT_HUD, qfalse, qtrue, character_s::score, chrScoreGlobal_s::skills, STATE_REACTION_MANY, sv_maxclients, edict_s::team, TEAM_CIVILIAN, edict_s::type, cvar_s::value, and edict_s::visflags.
Referenced by G_ClientEndRound().
void G_MoveCalc | ( | int | team, | |
const edict_t * | movingActor, | |||
const pos3_t | from, | |||
byte | crouchingState, | |||
int | distance | |||
) |
Precalculates a move table for a given team and a given starting position. This will calculate a routing table for all reachable fields with the given distance from the given spot with the given actorsize.
[in] | team | The current team (see G_BuildForbiddenList) |
[in] | from | Position in the map to start the move-calculation from. |
[in] | crouchingState | The crouching state of the actor. 0=stand, 1=crouch |
[in] | distance | The distance in TUs to calculate the move for. |
[in] | movingActor | The actor to calculate the move for |
Definition at line 93 of file g_move.c.
References G_MoveCalcLocal(), level, and level_locals_t::pathingMap.
Referenced by AI_PrepBestAction(), AI_TurnIntoDirection(), AIL_positionshoot(), G_ClientMove(), and pos3L_goto().
void G_MoveCalcLocal | ( | pathing_t * | pt, | |
int | team, | |||
const edict_t * | movingActor, | |||
const pos3_t | from, | |||
byte | crouchingState, | |||
int | distance | |||
) |
Same as G_MoveCalc
, except that it uses the pathing table passed as the first param.
[in] | pt | the pathfinding table |
[in] | team | The current team (see G_BuildForbiddenList) |
[in] | from | Position in the map to start the move-calculation from. |
[in] | crouchingState | The crouching state of the actor. 0=stand, 1=crouch |
[in] | distance | The distance in TUs to calculate the move for. |
[in] | movingActor | The actor to calculate the move for |
Definition at line 109 of file g_move.c.
References edict_s::fieldSize, forbiddenList, forbiddenListLength, G_BuildForbiddenList(), gi, and game_import_t::routingMap.
Referenced by AI_FindHerdLocation(), AI_FindHidingLocation(), and G_MoveCalc().
void G_PhysicsRun | ( | void | ) |
Handles door and other objects.
Definition at line 109 of file g_phys.c.
References level_locals_t::framenum, G_EdictsGetNextInUse(), G_MatchIsRunning(), G_PhysicsThink(), level, and edict_s::think.
Referenced by G_RunFrame().
void G_PhysicsStep | ( | edict_t * | ent | ) |
Definition at line 34 of file g_phys.c.
References moveinfo_t::contentFlags, edict_s::contentFlags, CONTENTS_WATER, moveinfo_t::currentStep, level_locals_t::framenum, G_IsCrouched, G_Trace(), G_VisToPM(), game_import_t::GetFootstepSound(), gi, level, MASK_SOLID, edict_s::moveinfo, cBspSurface_s::name, edict_s::nextthink, edict_s::origin, SERVER_FRAME_SECONDS, moveinfo_t::steps, trace_s::surface, edict_s::think, UNIT_HEIGHT, VectorCopy, and moveinfo_t::visflags.
Referenced by G_ClientMove().
Prints stats about who killed who with what and how.
[in] | victim | Pointer to edict being a victim. |
[in] | attacker | Pointer to edict being an attacker. |
[in] | fd | Pointer to fire definition used in attack. |
Definition at line 268 of file g_utils.c.
References edict_s::chr, Com_sprintf(), G_GetPlayerName(), G_GetWeaponNameForFiredef(), G_PrintStats(), edict_s::HP, fireDef_s::name, character_s::name, edict_s::pnum, edict_s::team, TEAM_ALIEN, and TEAM_CIVILIAN.
Referenced by G_ClientMove(), and G_Damage().
void G_PrintStats | ( | const char * | buffer | ) |
Prints stats to game console and stats log file.
Definition at line 242 of file g_utils.c.
References Com_sprintf(), gi, and logstatsfile.
Referenced by G_GetStartingTeam(), G_MatchDoEnd(), G_PrintActorStats(), and G_UpdateCharacterSkills().
Checks whether the actor is allowed to activate reaction fire and will informs the player about the reason if this would not work.
ent | The actor to check |
true
if the actor is allowed to activate it, false
otherwise Definition at line 170 of file g_reaction.c.
References _, level_locals_t::activeTeam, edict_s::chr, G_ActorHasEnoughTUsReactionFire(), G_ActorHasReactionFireEnabledWeapon(), G_ActorHasWorkingFireModeSet(), G_ClientPrintf(), G_IsLivingActor(), G_MatchIsRunning(), G_PLAYER_FROM_ENT, edict_s::inuse, level, PRINT_HUD, qfalse, qtrue, edict_s::team, character_s::teamDef, and teamDef_s::weapons.
Referenced by G_ClientStateChange().
void G_ReactionFireEndTurn | ( | void | ) |
Called at the end of turn, all outstanding reaction fire is resolved.
Definition at line 480 of file g_reaction.c.
References G_EdictsGetNextLivingActor(), G_ReactionFireTryToShoot(), and edict_s::reactionTarget.
Referenced by G_ClientEndRound().
Called when 'target' moves, possibly triggering or resolving reaction fire.
[in] | target | The target entity |
Definition at line 411 of file g_reaction.c.
References G_ReactionFireCheckExecution(), and G_ReactionFireSearchTarget().
Referenced by G_ClientMove().
void G_ReactionFirePostShot | ( | edict_t * | target | ) |
Called after 'target' has fired, this might trigger more reaction fire or resolve outstanding reaction fire (because target is out of time).
[in] | target | The entity that has just fired |
Definition at line 470 of file g_reaction.c.
References G_ReactionFireCheckExecution().
Referenced by G_ClientShoot().
void G_ReactionFirePreShot | ( | const edict_t * | target, | |
const int | fdTime | |||
) |
Called when 'target' is about to shoot, this forces a 'draw' to decide who gets the first shot.
[in] | target | The entity about to shoot |
[in] | fdTime | The TU of the shoot |
Definition at line 428 of file g_reaction.c.
References G_EdictsGetNextLivingActor(), G_ReactionFireGetTUsForItem(), G_ReactionFireSearchTarget(), G_ReactionFireTryToShoot(), qtrue, edict_s::reactionNoDraw, edict_s::reactionTarget, and RIGHT.
Referenced by G_ClientShoot().
void G_ReactionFireReset | ( | int | team | ) |
Guess! Reset all "shaken" states on end of turn?
[in] | team | Index of team to loop through. |
Definition at line 499 of file g_reaction.c.
References EV_ACTOR_STATECHANGE, G_EdictsGetNextLivingActorOfTeam(), G_RemoveShaken, G_TeamToPM(), gi, edict_s::number, qfalse, edict_s::reactionNoDraw, edict_s::reactionTarget, edict_s::reactionTUs, edict_s::state, and edict_s::team.
Referenced by G_ClientEndRound().
ent | The actor to set the reaction fire for |
true
if the needed settings could have been made or settings are already valid, false
otherwise. Definition at line 135 of file g_reaction.c.
References ACTOR_GET_INV, ACTOR_HAND_LEFT, ACTOR_HAND_RIGHT, edict_s::chr, chrFiremodeSettings_s::fmIdx, G_ActorHasWorkingFireModeSet(), G_EventReactionFireChange(), G_IsAI, chrFiremodeSettings_s::hand, INVSH_HasReactionFireEnabledWeapon(), qfalse, qtrue, character_s::RFmode, and chrFiremodeSettings_s::weapon.
Referenced by G_ClientStateChange().
void G_ReactionFireUpdate | ( | edict_t * | ent, | |
fireDefIndex_t | fmIdx, | |||
actorHands_t | hand, | |||
const objDef_t * | od | |||
) |
Updates the reaction fire settings in case something was moved into a hand or from a hand that would make the current settings invalid.
ent | The actor edict to check the settings for |
Definition at line 102 of file g_reaction.c.
References edict_s::chr, chrFiremodeSettings_s::fmIdx, G_ActorHasWorkingFireModeSet(), G_ClientStateChange(), G_EventReactionFireChange(), G_PLAYER_FROM_ENT, chrFiremodeSettings_s::hand, qfalse, character_s::RFmode, STATE_REACTION, and chrFiremodeSettings_s::weapon.
Referenced by G_ActorInvMove(), and G_ClientAction().
Read item from the network buffer.
[in,out] | item | item_t being send through net. |
[in,out] | container | Container which is being updated with item sent. |
[in] | x | Position of item in given container. |
[in] | y | Position of item in given container. |
Definition at line 286 of file g_inventory.c.
References item_s::a, item_s::amount, game_import_t::csi, gi, INVDEF, item_s::m, m, NONE, csi_s::numODs, csi_s::ods, item_s::rotated, and item_s::t.
Referenced by G_ClientReadInventory().
void G_RecalcRouting | ( | const edict_t * | ent | ) |
Definition at line 434 of file g_utils.c.
References G_GenerateEntList(), gi, MAX_EDICTS, edict_s::model, and game_import_t::routingMap.
Referenced by Destroy_Breakable(), Door_Use(), and G_CompleteRecalcRouting().
void void G_ResetClientData | ( | void | ) |
Called after every player has joined.
Definition at line 1438 of file g_client.c.
References scoreMissionNum.
Referenced by G_SpawnEntities().
qboolean G_RunFrame | ( | void | ) |
Definition at line 405 of file g_main.c.
References AI_Run(), CheckNeedPass(), CS_MAXTEAMS, game_import_t::Cvar_Set(), level_locals_t::framenum, G_CheckForceEndRound(), G_CompleteRecalcRouting(), G_MatchDoEnd(), G_MatchIsRunning(), G_PhysicsRun(), G_SendBoundingBoxes(), cvar_s::integer, cvar_s::modified, qfalse, qtrue, level_locals_t::roundstartTime, level_locals_t::routed, SERVER_FRAME_SECONDS, and level_locals_t::time.
Referenced by GetGameAPI().
void G_SendInventory | ( | unsigned int | playerMask, | |
const edict_t * | ent | |||
) |
Sends whole inventory through the network buffer.
[in] | playerMask | The player mask to determine which clients should receive the event (G_VisToPM (ent->visflags)). |
[in] | ent | Pointer to an actor or floor container with inventory to send. |
Definition at line 334 of file g_inventory.c.
References CONTAINER, game_import_t::csi, G_EventInventoryAdd(), G_WriteItem(), gi, INVDEF, invList_s::item, invList_s::next, csi_s::numIDs, item_s::t, invList_s::x, and invList_s::y.
Referenced by G_AppearPerishEvent(), and G_MatchSendResults().
void G_SendInvisible | ( | player_t * | player | ) |
This function sends all the actors to the client that are not visible initially - this is needed because an actor can e.g. produce sounds that are send over the net. And the client can only handle them if he knows the le_t
(local entity) already.
G_CheckVis
call for every new actor or player Definition at line 255 of file g_client.c.
References edict_s::chr, EV_ACTOR_ADD, edict_s::fieldSize, G_EdictsGetNextActor(), G_IsVisibleForTeam, G_PlayerToPM, character_s::gender, gi, teamDef_s::idx, level, NONE, level_locals_t::num_alive, edict_s::number, player_s::pers, edict_s::pnum, edict_s::pos, edict_s::state, STATE_PUBLIC, edict_s::team, client_persistant_t::team, TEAM_NO_ACTIVE, and character_s::teamDef.
Referenced by G_ClientSpawn().
void G_SendPlayerStats | ( | const player_t * | player | ) |
Write player stats to network buffer.
Definition at line 46 of file g_stats.c.
References G_EdictsGetNextActor(), G_SendStats(), player_s::pers, client_persistant_t::team, and edict_s::team.
Referenced by G_ClientSpawn().
void G_SendState | ( | unsigned int | playerMask, | |
const edict_t * | ent | |||
) |
Definition at line 109 of file g_client.c.
References EV_ACTOR_STATECHANGE, G_TeamToPM(), gi, edict_s::number, edict_s::state, STATE_PUBLIC, and edict_s::team.
Referenced by G_ClientStateChangeUpdate(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), and G_MoraleStopRage().
void G_SendStats | ( | edict_t * | ent | ) |
Send stats to network buffer.
Definition at line 31 of file g_stats.c.
References G_EventActorStats(), edict_s::HP, edict_s::morale, edict_s::STUN, and edict_s::TU.
Referenced by G_ActorCheckRevitalise(), G_ActorInvMove(), G_ClientMove(), G_ClientShoot(), G_ClientStateChangeUpdate(), G_ClientTurn(), G_ClientUseEdict(), G_Damage(), G_GiveTimeUnits(), G_Morale(), G_MoraleBehaviour(), and G_SendPlayerStats().
void G_ServerCommand | ( | void | ) |
ServerCommand will be called when an "sv" command is issued. The game can issue gi.Cmd_Argc() / gi.Cmd_Argv() commands to get the rest of the parameters.
Definition at line 325 of file g_svcmds.c.
References game_import_t::Cmd_Argv(), gi, Q_strcasecmp, SVCmd_AddIP_f(), SVCmd_AI_Add_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_Win_f(), and SVCmd_WriteIP_f().
Referenced by GetGameAPI().
void G_SetTeamForPlayer | ( | player_t * | player, | |
const int | team | |||
) |
Definition at line 809 of file g_client.c.
References G_IsAIPlayer, g_nospawn, gi, Info_SetValueForKeyAsInteger(), cvar_s::integer, level, MAX_TEAMS, level_locals_t::num_spawnpoints, player_s::pers, client_persistant_t::team, TEAM_NO_ACTIVE, and client_persistant_t::userinfo.
Referenced by AI_CreatePlayer(), and G_GetTeam().
edict_t* G_Spawn | ( | void | ) |
Either finds a free edict, or allocates a new one.
Definition at line 400 of file g_spawn.c.
References G_EdictsGetNewEdict(), G_InitEdict(), and gi.
Referenced by G_SpawnEntities(), G_SpawnFloor(), G_SpawnParticle(), and G_TriggerSpawn().
void G_SpawnEntities | ( | const char * | mapname, | |
qboolean | day, | |||
const char * | entities | |||
) |
Creates a server's entity / program execution context by parsing textual entity definitions out of an ent file.
Definition at line 313 of file g_spawn.c.
References level_locals_t::activeTeam, level_locals_t::actualRound, AI_CreatePlayer(), ai_numactors, ai_waypointList, Com_Parse(), Com_Printf(), level_locals_t::day, ED_CallSpawn(), ED_ParseEdict(), G_EdictCalcOrigin(), G_EdictsGetFirst(), G_EdictsReset(), G_FindEdictGroups(), G_FreeTags, G_ResetClientData(), G_Spawn(), game, inventoryInterface_s::GetUsedSlots, gi, level_locals_t::hurtAliens, game_locals_t::i, cvar_s::integer, level, level_locals_t::mapname, edict_s::mapNum, level_locals_t::num_spawnpoints, edict_s::origin, edict_s::pos, Q_strncpyz(), edict_s::solid, SOLID_BBOX, sv_hurtaliens, sv_maxclients, TAG_LEVEL, TEAM_ALIEN, TEAM_CIVILIAN, TEAM_NO_ACTIVE, and VecToPos.
Referenced by GetGameAPI().
Spawns a new entity at the floor.
Definition at line 415 of file g_spawn.c.
References ACTOR_SIZE_NORMAL, edict_s::classname, ET_ITEM, edict_s::fieldSize, G_EdictCalcOrigin(), G_Spawn(), gi, edict_s::pos, game_import_t::routingMap, edict_s::type, and VectorCopy.
Referenced by G_ActorInvMove(), G_AddItemToFloor(), G_InventoryToFloor(), and G_SpawnItemOnFloor().
This is only for particles that are spawned during a match - not for map particles.
Definition at line 434 of file g_spawn.c.
References edict_s::classname, ET_PARTICLE, G_CheckVis(), G_Spawn(), edict_s::origin, edict_s::particle, edict_s::pos, qtrue, edict_s::spawnflags, edict_s::type, VecToPos, and VectorCopy.
Referenced by Destroy_Breakable(), G_MissionThink(), G_ShootSingle(), and G_SplashDamage().
void G_TakeDamage | ( | edict_t * | ent, | |
int | damage | |||
) |
Applies the given damage value to an edict that is either an actor or has the FL_DESTROYABLE
flag set.
ent | The edict to apply the damage to. | |
damage | The damage value. |
Definition at line 170 of file g_utils.c.
References G_IsActor, G_IsBreakable, and edict_s::HP.
Referenced by G_ActorFall(), G_Damage(), and Touch_HurtTrigger().
unsigned int G_TeamToPM | ( | int | team | ) |
Generates the player bit mask for a given team.
[in] | team | The team to create the player bit mask for |
Definition at line 37 of file g_client.c.
References game, i, player_s::inuse, player_s::pers, game_locals_t::players, game_locals_t::sv_maxplayersperteam, and client_persistant_t::team.
Referenced by G_ActorInvMove(), G_AppearPerishEvent(), G_CheckVisTeam(), G_EventActorStats(), G_EventSetClientAction(), G_MatchSendResults(), G_ReactionFireReset(), and G_SendState().
fast version of a line trace but without including entities
start | The start vector of the trace | |
end | The end vector of the trace |
false
if not blocked Definition at line 209 of file g_utils.c.
References G_TraceDraw(), gi, and TL_FLAG_NONE.
Referenced by G_TeamPointVis().
fast version of a line trace including entities
start | The start vector of the trace | |
end | The end vector of the trace |
false
if not blocked Definition at line 193 of file g_utils.c.
References G_GenerateEntList(), G_TraceDraw(), gi, MAX_EDICTS, and TL_FLAG_NONE.
Referenced by G_LineVis().
int G_TestVis | ( | const int | team, | |
edict_t * | check, | |||
int | flags | |||
) |
test if check is visible by team (or if visibility changed?)
[in] | team | the team the edict may become visible for or perish from their view |
[in] | check | the edict we are talking about - which may become visible or perish |
[in] | flags | if you want to check whether the edict may also perish from other players view, you should use the VT_PERISH bits |
VT_PERISH
, no further checks are performed - only the VIS_YES
bits are returned Definition at line 205 of file g_vis.c.
References g_aidebug, G_EdictsGetNextInUse(), G_IsVisibleForTeam, G_Vis(), cvar_s::integer, VIS_YES, and VT_PERISH.
Referenced by AI_FighterCalcBestAction(), AI_FindHidingLocation(), and G_DoTestVis().
void G_TouchEdicts | ( | edict_t * | ent, | |
float | extend | |||
) |
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it covers to immediately touch it.
[in] | ent | The edict to check. |
[in] | extend | Extend value for the bounding box |
Definition at line 541 of file g_utils.c.
References edict_s::absmax, edict_s::absmin, edict_s::chr, Com_DPrintf(), DEBUG_GAME, gi, i, edict_s::inuse, MAX_EDICTS, edict_s::model, character_s::name, and edict_s::touch.
Referenced by Destroy_Breakable().
void G_TouchSolids | ( | edict_t * | ent | ) |
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it covers to immediately touch it.
Definition at line 513 of file g_utils.c.
References edict_s::absmax, edict_s::absmin, gi, i, edict_s::inuse, MAX_EDICTS, edict_s::solid, SOLID_TRIGGER, and edict_s::touch.
int G_TouchTriggers | ( | edict_t * | ent | ) |
Check the world against triggers for the current entity.
[in,out] | ent | The entity that maybe touches others |
Definition at line 483 of file g_utils.c.
References edict_s::absmax, edict_s::absmin, G_IsLivingActor(), G_ResetTriggers(), gi, i, MAX_EDICTS, edict_s::solid, SOLID_TRIGGER, and edict_s::touch.
Referenced by G_ActorUseDoor(), G_ClientGetFreeSpawnPointForActorSize(), and G_ClientMove().
collision detection - this version is more accurate and includes entity tests
Definition at line 221 of file g_utils.c.
References G_TraceDraw(), and gi.
Referenced by G_PhysicsStep(), G_ShootGrenade(), and G_ShootSingle().
Definition at line 32 of file g_trigger.c.
References edict_s::absmax, edict_s::absmin, edict_s::classname, ET_TRIGGER, G_Spawn(), gi, edict_s::maxs, edict_s::mins, edict_s::owner, edict_s::solid, SOLID_TRIGGER, edict_s::type, UNIT_SIZE, and VectorCopy.
Referenced by SP_func_door(), SP_misc_mission(), and SP_misc_mission_aliens().
Call the 'use' function for the given edict and all its group members.
[in] | ent | The edict to call the use function for |
[in] | activator | The edict that uses ent |
Definition at line 77 of file g_utils.c.
References FL_GROUPSLAVE, edict_s::flags, G_UseEdict(), edict_s::groupChain, qfalse, qtrue, and edict_s::use.
Referenced by G_ClientUseEdict(), G_UseEdict(), and SP_func_door().
test if check is visible by from
[in] | team | Living team members are always visible. If this is a negative number we inverse the team rules (see comments included). In combination with VT_NOFRUSTUM we can check whether there is any edict (that is no in our team) that can see check |
[in] | from | is from team team and must be a living actor |
[in] | check | The edict we want to get the visibility for |
[in] | flags | VT_NOFRUSTUM , ... |
Definition at line 132 of file g_vis.c.
References ACTOR_VIS_0, ACTOR_VIS_100, ET_ACTOR, ET_ACTOR2x2, ET_ITEM, ET_PARTICLE, EYE_CROUCH, EYE_STAND, G_ActorVis(), G_FrustumVis(), G_IsCivilian, G_IsCrouched, G_IsDead, G_IsLivingActor(), G_IsPaniced, G_IsVisibleOnBattlefield, G_LineVis(), edict_s::inuse, MAX_SPOT_DIST, edict_s::origin, edict_s::pos, qfalse, edict_s::team, edict_s::type, VectorCompare, VectorCopy, VectorDistSqr, and VT_NOFRUSTUM.
Referenced by AI_HideNeeded(), AIL_see(), and G_TestVis().
unsigned int G_VisToPM | ( | unsigned int | vis_mask | ) |
Converts vis mask to player mask.
[in] | vis_mask | The visibility bit mask (contains the team numbers) that is converted to a player mask |
vis_mask
. Definition at line 59 of file g_client.c.
References G_TeamToVisMask, game, i, player_s::inuse, player_s::pers, game_locals_t::players, game_locals_t::sv_maxplayersperteam, and client_persistant_t::team.
Referenced by G_ActorInvMove(), G_CenterView(), G_ClientMove(), G_ClientShoot(), G_ClientStateChangeUpdate(), G_EventActorDie(), G_EventActorFall(), G_EventActorRevitalise(), G_EventActorTurn(), G_EventInventoryAmmo(), G_EventPerish(), G_EventShoot(), G_EventShootHidden(), G_EventStartShoot(), G_EventThrow(), G_InventoryRemoveItemByID(), G_MatchSendResults(), G_MissionThink(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_MoraleStopRage(), G_PhysicsStep(), and G_SplashDamage().
Write an item to the network buffer.
[in,out] | item | item_t being send through net. |
[in,out] | container | Container which is being updated with item sent. |
[in] | x | Position of item in given container. |
[in] | y | Position of item in given container. |
Definition at line 320 of file g_inventory.c.
References item_s::a, item_s::amount, gi, invDef_s::id, objDef_s::idx, item_s::m, NONE, item_s::rotated, and item_s::t.
Referenced by G_ActorInvMove(), and G_SendInventory().
void SP_func_breakable | ( | edict_t * | ent | ) |
func_breakable (0.3 0.3 0.3) ? Used for breakable objects.
Definition at line 119 of file g_func.c.
References edict_s::classname, Com_DPrintf(), DEBUG_GAME, edict_s::destroy, Destroy_Breakable(), ET_BREAKABLE, FL_DESTROYABLE, edict_s::flags, gi, edict_s::mapNum, edict_s::maxs, edict_s::mins, edict_s::model, edict_s::origin, edict_s::solid, SOLID_BSP, edict_s::touch, Touch_Breakable(), and edict_s::type.
void SP_func_door | ( | edict_t * | ent | ) |
func_door (0 .5 .8) ? "health" if set, door is destroyable
Definition at line 250 of file g_func.c.
References edict_s::absmax, edict_s::absmin, edict_s::child, edict_s::classname, Com_DPrintf(), DEBUG_GAME, edict_s::destroy, Destroy_Breakable(), Door_Use(), edict_s::doorState, ET_DOOR, FL_DESTROYABLE, FL_TRIGGERED, edict_s::flags, G_ActorSetTU(), G_TriggerSpawn(), G_UseEdict(), gi, edict_s::HP, edict_s::mapNum, edict_s::maxs, edict_s::mins, edict_s::model, edict_s::noise, edict_s::origin, edict_s::reset, Reset_DoorTrigger(), edict_s::solid, SOLID_BSP, edict_s::spawnflags, STATE_CLOSED, edict_s::touch, Touch_DoorTrigger(), TU_DOOR_ACTION, edict_s::type, and edict_s::use.
void SP_func_rotating | ( | edict_t * | ent | ) |
Spawns a rotating solid inline brush model.
Definition at line 297 of file g_func.c.
References edict_s::classname, Com_DPrintf(), DEBUG_GAME, ET_ROTATING, FL_DESTROYABLE, edict_s::flags, gi, edict_s::HP, edict_s::mapNum, edict_s::maxs, edict_s::mins, edict_s::model, edict_s::origin, edict_s::solid, SOLID_BSP, edict_s::speed, and edict_s::type.
void SP_trigger_hurt | ( | edict_t * | ent | ) |
Trigger for grid fields if they are under fire.
Definition at line 93 of file g_trigger.c.
References edict_s::child, edict_s::classname, edict_s::dmg, ET_TRIGGER_HURT, gi, edict_s::model, edict_s::solid, SOLID_TRIGGER, edict_s::touch, Touch_HurtTrigger(), and edict_s::type.
void SP_trigger_rescue | ( | edict_t * | ent | ) |
Rescue trigger to mark an actor to be in the rescue zone. Aborting a game would not kill the actors inside this trigger area.
Definition at line 192 of file g_trigger.c.
References edict_s::child, edict_s::classname, ET_TRIGGER_RESCUE, gi, edict_s::model, edict_s::reset, Reset_RescueTrigger(), edict_s::solid, SOLID_TRIGGER, edict_s::touch, Touch_RescueTrigger(), and edict_s::type.
void SP_trigger_touch | ( | edict_t * | ent | ) |
Touch trigger to call the use function of the attached target.
Definition at line 143 of file g_trigger.c.
References edict_s::child, edict_s::classname, ET_TRIGGER_TOUCH, G_FreeEdict(), gi, edict_s::model, edict_s::solid, SOLID_TRIGGER, edict_s::target, edict_s::touch, Touch_TouchTrigger(), and edict_s::type.
qboolean SV_FilterPacket | ( | const char * | from | ) |
Definition at line 100 of file g_svcmds.c.
References byte, ipfilter_t::compare, i, cvar_s::integer, m, numipfilters, and sv_filterban.
Referenced by G_ClientConnect().
Definition at line 70 of file g_main.c.
Referenced by AI_CreatePlayer(), G_SpawnEntities(), and SP_alien_start().
Definition at line 68 of file g_main.c.
Referenced by AI_CreatePlayer().
Definition at line 69 of file g_main.c.
Referenced by AI_CreatePlayer(), and SP_civilian_start().
Definition at line 902 of file g_ai.c.
Referenced by AI_CheckForMissionTargets(), and G_SpawnEntities().
Definition at line 118 of file g_main.c.
Referenced by G_Damage().
Definition at line 114 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 115 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 116 of file g_main.c.
Referenced by G_CheckFlood().
Definition at line 113 of file g_main.c.
Referenced by G_ClientMove().
Definition at line 108 of file g_main.c.
Referenced by G_TestVis().
Definition at line 109 of file g_main.c.
Referenced by G_TraceDraw().
Definition at line 110 of file g_main.c.
Referenced by G_Damage().
Definition at line 112 of file g_main.c.
Referenced by G_SetTeamForPlayer().
Definition at line 111 of file g_main.c.
Referenced by G_ClientMove().
Definition at line 106 of file g_main.c.
Referenced by G_ReactionFireCheckExecution().
Definition at line 32 of file g_main.c.
Referenced by AI_CreatePlayer(), AI_Run(), AI_SetEquipment(), G_ActorInvMove(), G_AddItemToFloor(), G_CheckForceEndRound(), G_ClientEndRound(), G_ClientReadInventory(), G_ClientShoot(), G_ClientTeamInfo(), G_EdictsGetNewEdict(), G_EdictsInit(), G_EdictsReset(), G_GetPlayerForTeam(), G_GetPlayerName(), G_GetStartingTeam(), G_GetTeam(), G_InventoryDropToFloorCheck(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_Players_f(), G_Say_f(), G_SpawnEntities(), G_SpawnItemOnFloor(), G_TeamToPM(), and G_VisToPM().
Definition at line 34 of file g_main.c.
Referenced by AI_ActorThink(), AI_CheckForMissionTargets(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_CreatePlayer(), AI_FighterCalcBestAction(), AI_FindHerdLocation(), AI_FindHidingLocation(), AI_InitPlayer(), AI_PrepBestAction(), AI_SearchBestTarget(), AI_SetCharacterValues(), AI_SetEquipment(), AI_TryToReloadWeapon(), AI_TurnIntoDirection(), AIL_ActorThink(), AIL_canreload(), AIL_Init(), AIL_InitActor(), AIL_positionshoot(), AIL_print(), AIL_reload(), AIL_Shutdown(), AIL_toTeamInt(), AIL_toTeamString(), Destroy_Breakable(), Door_Use(), ED_ParseEdict(), FS_LoadPackFile(), G_Actor2x2Spawn(), G_ActorFall(), G_ActorInvMove(), G_ActorReload(), G_ActorSetMaxs(), G_ActorSpawn(), G_AddItemToFloor(), G_AppearPerishEvent(), G_BuildForbiddenList(), G_CenterView(), G_CharacterGetMaxExperiencePerMission(), G_CheckForceEndRound(), G_ClientAction(), G_ClientAssignDefaultActorValues(), G_ClientBegin(), G_ClientCanReload(), G_ClientCommand(), G_ClientConnect(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientGetWeaponFromInventory(), G_ClientInitActorStates(), G_ClientMove(), G_ClientPrintf(), G_ClientReadCharacter(), G_ClientReadInventory(), G_ClientSendEdictsAndBrushModels(), G_ClientShoot(), G_ClientSkipActorInfo(), G_ClientSpawn(), G_ClientStateChange(), G_ClientStateChangeUpdate(), G_ClientTeamInfo(), G_ClientTurn(), G_ClientUseEdict(), G_ClientUserinfoChanged(), G_Damage(), G_EdictAppear(), G_EdictCalcOrigin(), G_EdictSetOrigin(), G_EdictsGetByNum(), G_EventActorDie(), G_EventActorFall(), G_EventActorRevitalise(), G_EventActorSendReservations(), G_EventActorStats(), G_EventActorTurn(), G_EventDestroyEdict(), G_EventEndRound(), G_EventInventoryAdd(), G_EventInventoryAmmo(), G_EventInventoryDelete(), G_EventInventoryReload(), G_EventParticleSpawn(), G_EventPerish(), G_EventReactionFireChange(), G_EventResetClientAction(), G_EventSendEdict(), G_EventSetClientAction(), G_EventShoot(), G_EventShootHidden(), G_EventSpawnSound(), G_EventStartShoot(), G_EventThrow(), G_FireAffectedSurface(), G_FreeEdict(), G_GetObjectForFiredef(), G_GetShotOrigin(), G_GetTeam(), G_InventoryDropToFloorCheck(), G_InventoryRemoveItemByID(), G_InventoryToFloor(), G_MatchSendResults(), G_MissionThink(), G_MissionTouch(), G_MissionUse(), G_Morale(), G_MoraleBehaviour(), G_MoralePanic(), G_MoraleRage(), G_MoveCalcLocal(), G_PhysicsStep(), G_PhysicsThink(), G_PrepareShot(), G_PrintStats(), G_ReactionFireReset(), G_ReadItem(), G_RecalcRouting(), G_Say_f(), G_SendCharacterData(), G_SendInventory(), G_SendInvisible(), G_SendParticle(), G_SendState(), G_ServerCommand(), G_SetTeamForPlayer(), G_ShootGrenade(), G_ShootSingle(), G_Spawn(), G_SpawnAIPlayer(), G_SpawnEntities(), G_SpawnFloor(), G_SpawnItemOnFloor(), G_SplashDamage(), G_TestLine(), G_TestLineWithEnts(), G_TouchEdicts(), G_TouchSolids(), G_TouchTriggers(), G_Trace(), G_TriggerSpawn(), G_WriteItem(), pos3L_goto(), SP_civilian_target(), SP_func_breakable(), SP_func_door(), SP_func_rotating(), SP_misc_item(), SP_misc_message(), SP_misc_mission(), SP_misc_mission_aliens(), SP_misc_model(), SP_trigger_hurt(), SP_trigger_rescue(), SP_trigger_touch(), SP_worldspawn(), SVCmd_AddIP_f(), SVCmd_AI_Add_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_Win_f(), SVCmd_WriteIP_f(), and Touch_TouchTrigger().
Definition at line 35 of file g_main.c.
Referenced by G_EdictsGetNewEdict(), G_EdictsGetNext(), G_EdictsGetNextActor(), G_EdictsGetNumber(), and G_EdictsIsValidNum().
Definition at line 33 of file g_main.c.
Referenced by _ase_load(), _pico_parse_skip_braced(), AI_CheckForMissionTargets(), AI_CivilianCalcBestAction(), AI_FighterCalcBestAction(), AI_PrepBestAction(), AI_Run(), AI_TurnIntoDirection(), AIL_positionshoot(), capture_to_close(), db_errorfb(), Destroy_Breakable(), G_ActionCheckForCurrentTeam(), G_Actor2x2Spawn(), G_ActorDie(), G_ActorDieOrStun(), G_ActorRevitalise(), G_ActorSpawn(), G_ActorSpawnIsAllowed(), G_ActorStun(), G_CheckFlood(), G_CheckForceEndRound(), G_CheckVis(), G_ClientBegin(), G_ClientDisconnect(), G_ClientEndRound(), G_ClientGetFreeSpawnPoint(), G_ClientGetFreeSpawnPointForActorSize(), G_ClientMove(), G_ClientSpawn(), G_EventEndRound(), G_GetActiveTeam(), G_GetNextActiveTeam(), G_GetStartingTeam(), G_GetTeam(), G_MatchDoEnd(), G_MatchEndCheck(), G_MatchEndTrigger(), G_MatchIsRunning(), G_MatchSendResults(), G_MissionThink(), G_MissionTouch(), G_Morale(), G_MoraleBehaviour(), G_MoveCalc(), G_PhysicsRun(), G_PhysicsStep(), G_PhysicsThink(), G_ReactionFireCanBeEnabled(), G_ReactionFireIsPossible(), G_SendInvisible(), G_SetTeamForPlayer(), G_ShootGrenade(), G_SpawnEntities(), getfunc(), luaB_error(), pos3L_goto(), RADAR_UpdateBaseRadarCoverage_f(), SP_alien_start(), SP_player_start(), SP_worldspawn(), start_capture(), TR_TestLineSingleTile(), UI_GenAllRadarMap(), UI_GenRadarMap_f(), and XVI_LoadXML().
FILE* logstatsfile |
Definition at line 50 of file g_main.c.
Referenced by G_Init(), G_PrintStats(), and G_Shutdown().
Definition at line 104 of file g_main.c.
Referenced by G_MoraleStopPanic().
Definition at line 102 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 103 of file g_main.c.
Referenced by G_MoraleStopRage().
Definition at line 101 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 73 of file g_main.c.
Referenced by G_Morale().
Definition at line 74 of file g_main.c.
Referenced by G_Morale().
Definition at line 77 of file g_main.c.
Referenced by G_Morale().
Definition at line 78 of file g_main.c.
Referenced by G_Morale().
Definition at line 76 of file g_main.c.
Referenced by G_Morale().
Definition at line 75 of file g_main.c.
Referenced by G_Morale().
Definition at line 94 of file g_main.c.
Referenced by G_Morale().
Definition at line 91 of file g_main.c.
Referenced by G_Morale().
Definition at line 99 of file g_main.c.
Referenced by AI_HideNeeded().
Definition at line 82 of file g_main.c.
Referenced by G_Morale().
Definition at line 85 of file g_main.c.
Referenced by G_Morale().
Definition at line 79 of file g_main.c.
Referenced by G_Morale().
Definition at line 98 of file g_main.c.
Referenced by G_ClientEndRound(), G_Damage(), G_MoraleBehaviour(), G_MoraleStopPanic(), and G_MoraleStopRage().
Definition at line 96 of file g_main.c.
Referenced by G_MoraleBehaviour().
Definition at line 97 of file g_main.c.
Referenced by G_MoraleBehaviour(), and G_ReactionFireIsPossible().
Definition at line 88 of file g_main.c.
Referenced by G_Morale().
Definition at line 37 of file g_main.c.
Referenced by G_ClientConnect().
Definition at line 58 of file g_main.c.
Referenced by AI_CreatePlayer().
Definition at line 46 of file common.c.
Referenced by CL_Init(), CL_InitAfter(), G_Say_f(), GAME_MP_StartServer_f(), Master_Heartbeat(), Master_Shutdown(), SV_BroadcastPrintf(), SV_Frame(), SV_Init(), SV_InitGame(), SV_SetMaster_f(), and SVC_Info().
Definition at line 43 of file g_main.c.
Referenced by G_IsMoraleEnabled(), and SP_worldspawn().
Definition at line 52 of file g_main.c.
Referenced by SV_FilterPacket(), and SVCmd_WriteIP_f().
Definition at line 61 of file g_main.c.
Referenced by G_SpawnEntities().
Definition at line 42 of file g_main.c.
Referenced by SP_worldspawn().
Definition at line 41 of file g_main.c.
Referenced by G_ActorSpawnIsAllowed(), SP_player_start(), and SP_worldspawn().
Definition at line 56 of file g_main.c.
Referenced by G_GetTeam(), and SP_worldspawn().
Definition at line 44 of file g_main.c.
Referenced by G_CheckForceEndRound().
Definition at line 62 of file g_main.c.
Referenced by G_ShootSingle().
Definition at line 59 of file g_main.c.
Referenced by G_ClientBegin(), G_ClientEndRound(), and G_GetTeam().