g_func.c File Reference

func_* edicts More...

#include "g_local.h"
Include dependency graph for g_func.c:

Go to the source code of this file.

Functions

static qboolean Touch_Breakable (edict_t *self, edict_t *activator)
 If an actor was standing on the breakable that is going to get destroyed, we have to let him fall to the ground.
static qboolean Destroy_Breakable (edict_t *self)
void SP_func_breakable (edict_t *ent)
 func_breakable (0.3 0.3 0.3) ? Used for breakable objects.
static qboolean Door_Use (edict_t *door, edict_t *activator)
 Opens/closes a door.
static qboolean Touch_DoorTrigger (edict_t *self, edict_t *activator)
 Trigger to open the door we are standing in front of it.
static void Reset_DoorTrigger (edict_t *self, edict_t *activator)
 Left the door trigger zone - reset the client action.
void SP_func_door (edict_t *ent)
 func_door (0 .5 .8) ? "health" if set, door is destroyable
void SP_func_rotating (edict_t *ent)
 Spawns a rotating solid inline brush model.

Detailed Description

func_* edicts

Definition in file g_func.c.


Function Documentation

static qboolean Destroy_Breakable ( edict_t self  )  [static]
static qboolean Door_Use ( edict_t door,
edict_t activator 
) [static]

Opens/closes a door.

Note:
Use function for func_door
Todo:
Check if the door can be opened or closed - there should not be anything in the way (e.g. an actor)

Definition at line 152 of file g_func.c.

References edict_s::angles, Com_DPrintf(), DEBUG_GAME, DOOR_ROTATION_ANGLE, edict_s::doorState, EV_DOOR_CLOSE, EV_DOOR_OPEN, G_CheckVis(), G_CheckVisTeamAll(), G_EventSpawnSound(), G_IsLivingActor(), G_MatchIsRunning(), G_RecalcRouting(), gi, edict_s::model, edict_s::noise, edict_s::number, edict_s::origin, PM_ALL, qfalse, qtrue, STATE_CLOSED, STATE_OPENED, edict_s::team, and YAW.

Referenced by SP_func_door().

static void Reset_DoorTrigger ( edict_t self,
edict_t activator 
) [static]

Left the door trigger zone - reset the client action.

Parameters:
self The trigger
activator The edict that left the trigger zone

Definition at line 237 of file g_func.c.

References edict_s::clientAction, and G_ActorSetClientAction().

Referenced by SP_func_door().

void SP_func_breakable ( edict_t ent  ) 

func_breakable (0.3 0.3 0.3) ? Used for breakable objects.

Note:
These edicts are added client side as local models, they are stored in the lmList (because they are inline models) for tracing (see inlineList in cmodel.c)
See also:
CM_EntTestLine
LM_AddModel
SV_SetModel
G_SendEdictsAndBrushModels

Definition at line 119 of file g_func.c.

References edict_s::classname, Com_DPrintf(), DEBUG_GAME, edict_s::destroy, Destroy_Breakable(), ET_BREAKABLE, FL_DESTROYABLE, edict_s::flags, gi, edict_s::mapNum, edict_s::maxs, edict_s::mins, edict_s::model, edict_s::origin, edict_s::solid, SOLID_BSP, edict_s::touch, Touch_Breakable(), and edict_s::type.

void SP_func_door ( edict_t ent  ) 
void SP_func_rotating ( edict_t ent  ) 
static qboolean Touch_Breakable ( edict_t self,
edict_t activator 
) [static]

If an actor was standing on the breakable that is going to get destroyed, we have to let him fall to the ground.

Parameters:
self The breakable edict
activator The touching edict
Note:
This touch function is only executed if the func_breakable edict has a HP level of 0 (e.g. it is already destroyed)
Returns:
false because this is no client action

Definition at line 39 of file g_func.c.

References G_ActorFall(), G_IsActor, and qfalse.

Referenced by SP_func_breakable().

static qboolean Touch_DoorTrigger ( edict_t self,
edict_t activator 
) [static]

Trigger to open the door we are standing in front of it.

See also:
CL_DoorOpen
LE_CloseOpen
CL_ActorDoorAction
AI_CheckUsingDoor

Definition at line 212 of file g_func.c.

References AI_CheckUsingDoor(), FL_GROUPSLAVE, G_ActorSetClientAction(), G_ActorUseDoor(), G_IsAI, edict_s::owner, qfalse, and qtrue.

Referenced by SP_func_door().


Generated by  doxygen 1.6.2