functions to handle the storage of all edicts in the game module. More...
#include "g_local.h"
Go to the source code of this file.
Functions | |
edict_t * | G_EdictsInit (void) |
Allocate space for the entity pointers. | |
void | G_EdictsReset (void) |
Reset the entity pointers for eg. a new game. | |
int | G_EdictsGetNumber (const edict_t *ent) |
Get an entity's ID number. | |
qboolean | G_EdictsIsValidNum (const int num) |
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_EdictsGetNewEdict (void) |
Find an entity that is not in use. | |
edict_t * | G_EdictsGetNextInUse (edict_t *lastEnt) |
Iterate through the entities that are in use. | |
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. | |
edict_t * | G_EdictsGetNextActor (edict_t *lastEnt) |
Iterate through the actor entities (even the dead! - but skips the invisible). | |
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 | |
static edict_t * | g_edicts |
functions to handle the storage of all edicts in the game module.
Definition in file g_edicts.c.
void G_EdictCalcOrigin | ( | edict_t * | ent | ) |
Calculate the edict's origin vector from it's grid position.
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.
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().
This is where we store the edicts
Definition at line 32 of file g_edicts.c.