50 for (
int i = 0;
i <
game.sv_maxentities;
i++)
63 assert(idx >= 0 && idx <
globals.num_edicts);
74 if (num >= 0 && num <
globals.num_edicts)
86 gi.DPrintf(
"Invalid edict num %i\n", num);
117 assert(lastEnt < endOfEnts);
119 Edict* ent = lastEnt;
122 if (ent >= endOfEnts)
131 if (duplicate ==
nullptr)
143 Edict* ent =
nullptr;
168 Edict* ent = lastEnt;
183 Edict* ent = lastEnt;
198 Edict* ent = lastEnt;
205 Sys_Error(
"dynamic_cast to Actor failed.");
218 Actor* actor = lastEnt;
233 Edict* ent = lastEnt;
242 Sys_Error(
"dynamic_cast to Actor failed.");
256 Actor* actor =
nullptr;
272 Actor* actor =
nullptr;
292 Edict* ent =
nullptr;
310 Edict* ent =
nullptr;
335 Sys_Error(
"Unexpected non-Actor Edict found.");
388 return selfControlled ? !actControlled : actControlled;
390 bool opponent =
true;
394 opponent = !actControlled;
398 opponent =
G_IsAlien(actor) || actControlled;
407 return selfControlled ? !opponent : opponent;
bool isState(int flag) const
bool isSameTeamAs(const Edict *other) const
camera_edict_data_t camera
bool(* _touch)(Edict *self, Edict *activator)
actorSizeEnum_t fieldSize
void(* think)(Edict *self)
pos3_t * forbiddenListPos
bool(* use)(Edict *self, Edict *activator)
bool(* destroy)(Edict *self)
bool isOpponent(const Actor *actor) const
Check if given actor is an enemy.
void(* reset)(Edict *self, Edict *activator)
linkedList_t * touchedList
#define ACTOR_SIZE_INVALID
bool G_IsLivingActor(const Edict *ent)
Checks whether the given edict is a living actor.
#define G_IsState(ent, s)
Edict * G_EdictsFindTargetEntity(const char *target)
Searches the edict that has the given target as targetname set.
Edict * G_EdictsGetFirst(void)
Returns the first entity.
Edict * G_EdictsConstruct(void)
Allocate space for the entity pointers.
Actor * G_EdictsGetNextLivingActorOfTeam(Actor *lastEnt, const int team)
Iterate through the living actor entities of the given team.
Edict * G_EdictsGetTriggerNextMaps(Edict *lastEnt)
Iterator through all the trigger_nextmap edicts.
Actor * G_EdictsGetActorByUCN(const int ucn, const int team)
Searches an actor by a unique character number.
Actor * G_EdictsGetNextActor(Actor *lastEnt)
Iterate through the actor entities (even the dead!).
Actor * makeActor(Edict *ent)
Convert an Edict pointer into an Actor pointer.
Edict * G_EdictsGetNewEdict(void)
Find an entity that is not in use.
Actor * G_EdictsGetNextLivingActor(Actor *lastEnt)
Iterate through the living actor entities.
bool G_EdictsIsValidNum(const int num)
Check if the given number could point to an existing entity.
Edict * G_EdictsGetNext(Edict *lastEnt)
Iterate through the list of entities.
Edict * G_EdictDuplicate(const Edict *edict)
int G_EdictsGetNumber(const Edict *ent)
Get an entity's ID number.
Edict * G_EdictsGetNextInUse(Edict *lastEnt)
Iterate through the entities that are in use.
void G_EdictsThink(void)
Called every frame to let the edicts tick.
Actor * G_EdictsGetLivingActorFromPos(const pos3_t pos)
Searches an actor at the given grid location.
Edict * G_EdictsGetByNum(const int num)
Get an entity by it's number.
void G_EdictsInit(void)
Reset the entity pointers for eg. a new game.
functions to handle the storage and lifecycle of all edicts in the game module.
#define SERVER_FRAME_SECONDS
#define G_IsTriggerNextMap(ent)
#define G_TagMalloc(size, tag)
#define G_IsCivilian(ent)
void Sys_Error(const char *error,...)
Artificial intelligence of a character.
#define VectorCompare(a, b)