UFO: Alien Invasion
|
functions to handle the storage and lifecycle of all edicts in the game module. More...
#include "g_local.h"
Go to the source code of this file.
Functions | |
Edict * | G_EdictsConstruct (void) |
Allocate space for the entity pointers. More... | |
void | G_EdictsInit (void) |
Reset the entity pointers for eg. a new game. More... | |
Edict * | G_EdictsGetNewEdict (void) |
Find an entity that is not in use. More... | |
Edict * | G_EdictDuplicate (const Edict *edict) |
int | G_EdictsGetNumber (const Edict *ent) |
Get an entity's ID number. More... | |
bool | G_EdictsIsValidNum (const int idx) |
Check if the given number could point to an existing entity. More... | |
Edict * | G_EdictsGetByNum (const int num) |
Get an entity by it's number. More... | |
Edict * | G_EdictsGetFirst (void) |
Returns the first entity. More... | |
Edict * | G_EdictsGetNext (Edict *lastEnt) |
Iterate through the list of entities. More... | |
Edict * | G_EdictsGetNextInUse (Edict *lastEnt) |
Iterate through the entities that are in use. More... | |
Actor * | G_EdictsGetNextActor (Actor *lastEnt) |
Iterate through the actor entities (even the dead!) More... | |
Actor * | G_EdictsGetNextLivingActor (Actor *lastEnt) |
Iterate through the living actor entities. More... | |
Actor * | G_EdictsGetNextLivingActorOfTeam (Actor *lastEnt, const int team) |
Iterate through the living actor entities of the given team. More... | |
Actor * | G_EdictsGetActorByUCN (const int ucn, const int team) |
Searches an actor by a unique character number. More... | |
Edict * | G_EdictsGetTriggerNextMaps (Edict *lastEnt) |
Iterator through all the trigger_nextmap edicts. More... | |
Actor * | G_EdictsGetLivingActorFromPos (const pos3_t pos) |
Searches an actor at the given grid location. More... | |
Edict * | G_EdictsFindTargetEntity (const char *target) |
Searches the edict that has the given target as targetname set. More... | |
void | G_EdictsThink (void) |
Called every frame to let the edicts tick. More... | |
functions to handle the storage and lifecycle of all edicts in the game module.
Definition in file g_edicts.h.
Definition at line 128 of file g_edicts.cpp.
References G_EdictsGetNewEdict(), G_EdictsGetNumber(), and Edict::number.
Referenced by G_ClientGetFreeSpawnPointForActorSize().
Allocate space for the entity pointers.
Definition at line 39 of file g_edicts.cpp.
References g_edicts, G_TagMalloc, game, game_locals_s::sv_maxentities, and TAG_GAME.
Referenced by G_Init().
Edict* G_EdictsFindTargetEntity | ( | 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 |
nullptr
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 290 of file g_edicts.cpp.
References G_EdictsGetNextInUse(), Q_streq, and Edict::targetname.
Referenced by G_MissionUse(), and Touch_TouchTrigger().
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 |
nullptr
Definition at line 254 of file g_edicts.cpp.
References Edict::chr, G_EdictsGetNextActor(), Edict::getTeam(), and character_s::ucn.
Referenced by G_ClientInitActorStates().
Get an entity by it's number.
[in] | num | The entity's index in the array of entities |
Definition at line 83 of file g_edicts.cpp.
References G_EdictsIsValidNum(), and gi.
Referenced by AI_CheckLineOfFire(), G_ClientAction(), G_EventShoot(), G_ShootGrenade(), G_ShootSingle(), ReactionFireTargets::notifyClientMove(), ReactionFireTargets::notifyClientOnShot(), and ReactionFireTargets::notifyClientOnStep().
Returns the first entity.
Definition at line 98 of file g_edicts.cpp.
Referenced by G_ClientSendEdictsAndBrushModels(), G_FindEdictGroups(), G_GetTouchingEdicts(), and G_SendBoundingBoxes().
Searches an actor at the given grid location.
pos | The grid location to look for an edict. |
nullptr
if nothing was found, otherwise the actor located at the given grid position. Definition at line 270 of file g_edicts.cpp.
References G_EdictsGetNextLivingActor(), Edict::pos, and VectorCompare.
Referenced by G_ActorShouldStopInMidMove(), G_ClientGetFreeSpawnPoint(), G_ClientShoot(), and G_SpawnItemOnFloor().
Find an entity that is not in use.
Definition at line 141 of file g_edicts.cpp.
References G_EdictsGetNext(), game, globals, Edict::inuse, game_export_s::num_edicts, and game_locals_s::sv_maxentities.
Referenced by G_EdictDuplicate(), and G_Spawn().
Iterate through the list of entities.
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 107 of file g_edicts.cpp.
References g_edicts, globals, and game_export_s::num_edicts.
Referenced by G_EdictsGetNewEdict(), and G_EdictsGetNextInUse().
Iterate through the actor entities (even the dead!)
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 231 of file g_edicts.cpp.
References G_EdictsGetNextInUse(), G_IsActor, globals, game_export_s::num_edicts, and Sys_Error().
Referenced by AIL_squad(), G_ClientEndRound(), G_EdictsGetActorByUCN(), G_MatchSendResults(), G_SendInvisible(), and G_SendPlayerStats().
Iterate through the entities that are in use.
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 166 of file g_edicts.cpp.
References G_EdictsGetNext(), and Edict::inuse.
Referenced by AI_CheckForMissionTargets(), AI_CheckPosition(), AI_SearchDestroyableObject(), AIL_findweapons(), AIL_missiontargets(), G_ActorCheckRevitalise(), G_BuildForbiddenList(), G_CheckVisPlayer(), G_CheckVisTeamAll(), G_ClientGetFreeSpawnPoint(), G_ClientSendEdictsAndBrushModels(), G_CompleteRecalcRouting(), G_EdictsFindTargetEntity(), G_EdictsGetNextActor(), G_EdictsGetNextLivingActor(), G_EdictsGetTriggerNextMaps(), G_EdictsThink(), G_FindEdictGroups(), G_FindRadius(), G_GenerateEntList(), G_GetEdictFromPos(), G_GetEdictFromPosExcluding(), G_GetTouchingEdicts(), G_ResetTriggers(), G_SendBoundingBoxes(), G_SmokeVis(), G_SplashDamage(), G_TeamPointVis(), G_TestVis(), G_VisFlagsClear(), G_VisMakeEverythingVisible(), and TEST_F().
Iterate through the living actor entities.
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 196 of file g_edicts.cpp.
References G_EdictsGetNextInUse(), G_IsLivingActor(), and Sys_Error().
Referenced by actorL_throwgrenade(), AI_CheckCrouch(), AI_CheckUsingDoor(), AI_CivilianCalcActionScore(), AI_FighterCalcActionScore(), AI_FindHerdLocation(), AI_HideNeeded(), AI_IsExposed(), AI_PanicCalcActionScore(), AIL_positionflee(), AIL_see(), ReactionFire::checkExecution(), G_ClientDisconnect(), G_EdictsGetLivingActorFromPos(), G_EdictsGetNextLivingActorOfTeam(), G_MatchSendResults(), G_Morale(), G_PlayerSoldiersCount(), G_ReactionFirePreShot(), G_ShotMorale(), and ReactionFire::updateAllTargets().
Iterate through the living actor entities of the given team.
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
team | The team we are looking for |
Definition at line 216 of file g_edicts.cpp.
References G_EdictsGetNextLivingActor(), and Edict::getTeam().
Referenced by AI_CheckFF(), AI_CheckForMissionTargets(), AI_FighterCalcActionScore(), AI_PlayerRun(), AIL_waypoints(), G_BleedWounds(), G_GiveTimeUnits(), G_MatchEndCheck(), G_MoraleBehaviour(), G_ReactionFireReset(), G_RoundTouchTriggers(), G_TeamPointVis(), G_UpdateCarriedWeight(), G_UpdateStunState(), and TEST_F().
Get an entity's ID number.
ent | The entity |
Definition at line 60 of file g_edicts.cpp.
References g_edicts, globals, and game_export_s::num_edicts.
Referenced by G_EdictDuplicate(), and G_Spawn().
Iterator through all the trigger_nextmap edicts.
lastEnt | The entity found in the previous iteration; if nullptr, we start at the beginning |
Definition at line 181 of file g_edicts.cpp.
References G_EdictsGetNextInUse(), and G_IsTriggerNextMap.
Referenced by G_MatchEndTrigger().
Reset the entity pointers for eg. a new game.
Definition at line 48 of file g_edicts.cpp.
References game, i, and game_locals_s::sv_maxentities.
Referenced by G_SpawnEntities().
bool 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 72 of file g_edicts.cpp.
References globals, and game_export_s::num_edicts.
Referenced by G_EdictsGetByNum().
Called every frame to let the edicts tick.
Definition at line 306 of file g_edicts.cpp.
References G_EdictsGetNextInUse(), level, Edict::nextthink, SERVER_FRAME_SECONDS, Edict::think, and level_locals_s::time.
Referenced by G_RunFrame().