UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
g_trigger.h File Reference

Trigger functions. More...

#include "g_local.h"

Go to the source code of this file.

Functions

bool G_TriggerIsInList (Edict *self, Edict *activator)
 Checks whether the activator of this trigger_touch was already recognized. More...
 
void G_TriggerAddToList (Edict *self, Edict *activator)
 Adds the activator to the list of recognized edicts for this trigger_touch edict. More...
 
bool G_TriggerRemoveFromList (Edict *self, Edict *activator)
 Removes an activator from the list of recognized edicts. More...
 
EdictG_TriggerSpawn (Edict *owner)
 
void Think_NextMapTrigger (Edict *self)
 Register this think function once you would like to end the match This think function will register the touch callback and spawns the particles for the client to see the next map trigger. More...
 
void SP_trigger_nextmap (Edict *ent)
 
bool Touch_HurtTrigger (Edict *self, Edict *activator)
 Hurt trigger. More...
 
void SP_trigger_hurt (Edict *ent)
 Trigger for grid fields if they are under fire. More...
 
void SP_trigger_touch (Edict *ent)
 Touch trigger to call the use function of the attached target. More...
 
void SP_trigger_rescue (Edict *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. More...
 

Detailed Description

Trigger functions.

Definition in file g_trigger.h.

Function Documentation

void G_TriggerAddToList ( Edict self,
Edict activator 
)

Adds the activator to the list of recognized edicts for this trigger_touch edict.

Parameters
selfThe trigger self pointer
activatorThe activating edict (might be nullptr)

Definition at line 67 of file g_trigger.cpp.

References linkedList_t::data, G_TagMalloc, G_TriggerIsInList(), linkedList_t::next, and TAG_LEVEL.

Referenced by G_TouchTriggers(), and Touch_Breakable().

bool G_TriggerIsInList ( Edict self,
Edict activator 
)

Checks whether the activator of this trigger_touch was already recognized.

Parameters
selfThe trigger self pointer
activatorThe activating edict (might be nullptr)
Returns
true if the activator is already in the list of recognized edicts or no activator was given, false if the activator is not yet part of the list

Definition at line 47 of file g_trigger.cpp.

References linkedList_t::data, and linkedList_t::next.

Referenced by G_ResetTriggers(), and G_TriggerAddToList().

bool G_TriggerRemoveFromList ( Edict self,
Edict activator 
)

Removes an activator from the list of recognized edicts.

Parameters
selfThe trigger self pointer
activatorThe activating edict (might be nullptr)
Returns
true if removal was successful or not needed, false if the activator wasn't found in the list

Definition at line 87 of file g_trigger.cpp.

References linkedList_t::data, G_MemFree, and linkedList_t::next.

Referenced by Destroy_Breakable(), and G_ResetTriggers().

void SP_trigger_hurt ( Edict ent)

Trigger for grid fields if they are under fire.

Note
Called once for every step
See also
Touch_HurtTrigger

Definition at line 255 of file g_trigger.cpp.

References Edict::classname, game_import_s::csi, csi_s::damFire, Edict::dmg, Edict::dmgtype, ET_TRIGGER_HURT, gi, Edict::model, Edict::reset, Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Touch_HurtTrigger(), and Edict::type.

void SP_trigger_rescue ( Edict 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.

Note
Called once for every step
See also
Touch_RescueTrigger

Definition at line 375 of file g_trigger.cpp.

References Edict::classname, ET_TRIGGER_RESCUE, G_FreeEdict(), G_IsMultiPlayer, gi, Edict::model, Edict::reset, Reset_RescueTrigger(), Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Edict::spawnflags, Touch_RescueTrigger(), and Edict::type.

void SP_trigger_touch ( Edict ent)

Touch trigger to call the use function of the attached target.

Note
Called once for every step
See also
Touch_TouchTrigger

Definition at line 320 of file g_trigger.cpp.

References Edict::classname, ET_TRIGGER_TOUCH, G_FreeEdict(), gi, Edict::model, Edict::reset, Reset_TouchTrigger(), Edict::setChild(), Edict::setTouch(), Edict::solid, SOLID_TRIGGER, Edict::target, Touch_TouchTrigger(), and Edict::type.

void Think_NextMapTrigger ( Edict self)

Register this think function once you would like to end the match This think function will register the touch callback and spawns the particles for the client to see the next map trigger.

Definition at line 153 of file g_trigger.cpp.

References _, G_EventCenterViewAt(), G_SpawnParticle(), gi, PM_ALL, PRINT_HUD, Touch_NextMapTrigger(), and VecToPos.

Referenced by G_MatchEndTrigger().