58 const char* model =
self->model;
60 self->absBox.getCenter(origin);
62 const char* breakSound =
nullptr;
63 switch (self->material) {
65 breakSound =
"misc/breakglass+";
68 breakSound =
"misc/breakmetal+";
71 breakSound =
"misc/breakelectric+";
74 breakSound =
"misc/breakwood+";
103 if (trigger->
reset !=
nullptr)
104 trigger->
reset(trigger, activator);
114 gi.GetInlineModelAABB(model, oldAABB);
116 rerouteOldBox.
set(oldAABB);
201 VectorMul(distance, moveAngles, distanceVec);
233 gi.GetInlineModelAABB(door->
model, oldAABB);
235 rerouteOldBox.
set(oldAABB);
263 gi.GetInlineModelAABB(door->
model, newAabb);
265 rerouteNewBox.
set(newAabb);
294 if (!self->owner()->inuse)
303 self =
self->groupMaster;
326 #define REVERSE 0x00000200
340 ent->
noise =
"doors/open_close";
379 ent->
noise =
"doors/slide";
void set(const pos3_t mini, const pos3_t maxi)
void SP_func_rotating(Edict *ent)
Spawns a rotating solid inline brush model.
void G_RecalcRouting(const char *model, const GridBox &box)
static bool Touch_Breakable(Edict *self, Edict *activator)
If an actor was standing on the breakable that is going to get destroyed, we have to let him fall to ...
void G_CheckVis(Edict *check, const vischeckflags_t visFlags)
Check if the edict appears/perishes for the other teams. If they appear for other teams...
Artificial Intelligence functions.
void SP_func_breakable(Edict *ent)
func_breakable (0.3 0.3 0.3) ? Used for breakable objects.
linkedList_t * touchedList
Misc utility functions for game module.
#define FL_CLIENTACTION
Edict flag to indicate, that the edict can be used in the context of a client action.
Edict * G_TriggerSpawn(Edict *owner)
unsigned int playermask_t
static bool Use_Breakable(Edict *self, Edict *activator)
bool(* use)(Edict *self, Edict *activator)
#define FL_TRIGGERED
Trigger the edict at spawn.
static void Reset_DoorTrigger(Edict *self, Edict *activator)
Left the door trigger zone - reset the client action.
bool AI_CheckUsingDoor(const Edict *ent, const Edict *door)
Checks whether the AI controlled actor wants to use a door.
static bool Destroy_Breakable(Edict *self)
void G_TouchEdicts(Edict *trigger, float extend)
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it c...
bool G_IsLivingActor(const Edict *ent)
Checks whether the given edict is a living actor.
Actor * makeActor(Edict *ent)
Convert an Edict pointer into an Actor pointer.
#define FL_GROUPSLAVE
not the first on the team
static bool Door_Use(Edict *door, Edict *activator)
Opens/closes a door.
#define Q_strvalid(string)
playermask_t G_GetClosePlayerMask(const vec3_t origin, float radius)
Assembles a player mask for those players that have a living team member close to the given location...
bool G_MatchIsRunning(void)
Checks whether the game is running (active team and no intermission time)
void setTouch(bool(*touch_)(Edict *self, Edict *activator))
static void Door_SlidingUse(Edict *door)
Slides a door.
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Create the rotation matrix in order to rotate something.
#define VectorMul(scalar, b, dest)
#define DotProduct(x, y)
Returns the distance between two 3-dimensional vectors.
#define DOOR_ROTATION_ANGLE
void G_EventDoorClose(const Edict &door)
void G_ActorUseDoor(Actor *actor, Edict *door)
Make the actor use (as in open/close) a door edict.
static bool Touch_DoorTrigger(Edict *self, Edict *activator)
Trigger to open the door we are standing in front of it.
Edict * G_SpawnParticle(const vec3_t origin, int spawnflags, const char *particle)
void G_EventModelExplodeTriggered(const Edict &ent, const char *sound)
void G_ActorSetClientAction(Edict *actor, Edict *ent)
Handles the client actions (interaction with the world)
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void(* reset)(Edict *self, Edict *activator)
#define GET_SLIDING_DOOR_SHIFT_VECTOR(dir, speed, vecout)
void SP_func_door_sliding(Edict *ent)
void G_EventDoorOpen(const Edict &door)
void G_EventSpawnSound(playermask_t playerMask, const Edict &ent, const vec3_t origin, const char *sound)
Spawns a sound (that will be spatialized on the client side)
int G_CheckVisTeamAll(const int team, const vischeckflags_t visFlags, const Edict *ent)
Do G_CheckVisTeam for all entities ent is the one that is looking at the others.
void asIntString(char *str, size_t len)
Prints a representation of the box.
#define VectorAdd(a, b, dest)
void G_EventModelExplode(const Edict &ent, const char *sound)
void G_TriggerAddToList(Edict *self, Edict *activator)
Adds the activator to the list of recognized edicts for this trigger_touch edict. ...
#define FL_DESTROYABLE
If an edict is destroyable (like ET_BREAKABLE, ET_DOOR [if health set] or maybe a ET_MISSION [if heal...
Brings new objects into the world.
void G_ActorSetTU(Edict *ent, int tus)
void setChild(Edict *child)
bool(* destroy)(Edict *self)
bool G_UseEdict(Edict *ent, Edict *activator)
Call the 'use' function for the given edict and all its group members.
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
void SP_func_door(Edict *ent)
func_door (0 .5 .8) ? "health" if set, door is destroyable
bool G_TriggerRemoveFromList(Edict *self, Edict *activator)
Removes an activator from the list of recognized edicts.
#define DOOR_OPEN_REVERSE
void G_FreeEdict(Edict *ent)
Marks the edict as free.
void G_ActorFall(Edict *ent)
Let an actor fall down if e.g. the func_breakable the actor was standing on was destroyed.