UFO: Alien Invasion
Loading...
Searching...
No Matches
g_func.cpp File Reference

func_* edicts More...

#include "g_func.h"
#include "g_actor.h"
#include "g_ai.h"
#include "g_match.h"
#include "g_move.h"
#include "g_spawn.h"
#include "g_trigger.h"
#include "g_utils.h"
#include "g_vis.h"
Include dependency graph for g_func.cpp:

Go to the source code of this file.

Macros

#define REVERSE   0x00000200

Functions

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 the ground.
static bool Destroy_Breakable (Edict *self)
static bool Use_Breakable (Edict *self, Edict *activator)
void SP_func_breakable (Edict *ent)
 func_breakable (0.3 0.3 0.3) ? Used for breakable objects.
static void Door_SlidingUse (Edict *door)
 Slides a door.
static bool Door_Use (Edict *door, Edict *activator)
 Opens/closes a door.
static bool Touch_DoorTrigger (Edict *self, Edict *activator)
 Trigger to open the door we are standing in front of it.
static void Reset_DoorTrigger (Edict *self, Edict *activator)
 Left the door trigger zone - reset the client action.
void SP_func_door (Edict *ent)
 func_door (0 .5 .8) ? "health" if set, door is destroyable
void SP_func_door_sliding (Edict *ent)
void SP_func_rotating (Edict *ent)
 Spawns a rotating solid inline brush model.

Detailed Description

func_* edicts

Definition in file g_func.cpp.

Macro Definition Documentation

◆ REVERSE

#define REVERSE   0x00000200

Definition at line 326 of file g_func.cpp.

Referenced by SP_func_door(), and SP_func_door_sliding().

Function Documentation

◆ Destroy_Breakable()

◆ Door_SlidingUse()

void Door_SlidingUse ( Edict * door)
static

Slides a door.

Note
The new door state must already be set
Parameters
[in,out]doorThe entity of the inline model. The aabb of this bmodel will get updated in this function to reflect the new door position in the world
See also
LET_SlideDoor

Definition at line 180 of file g_func.cpp.

References AngleVectors(), Edict::dir, Edict::doorState, DotProduct, GET_SLIDING_DOOR_SHIFT_VECTOR, Edict::origin, Edict::size, STATE_OPENED, VectorAbs, VectorAdd, and VectorMul.

Referenced by Door_Use().

◆ Door_Use()

bool Door_Use ( Edict * door,
Edict * activator )
static

◆ Reset_DoorTrigger()

void Reset_DoorTrigger ( Edict * self,
Edict * activator )
static

Left the door trigger zone - reset the client action.

Parameters
selfThe trigger
activatorThe edict that left the trigger zone

Definition at line 320 of file g_func.cpp.

References Edict::clientAction, G_ActorSetClientAction(), and Edict::owner().

Referenced by SP_func_door().

◆ SP_func_breakable()

void SP_func_breakable ( Edict * 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 144 of file g_func.cpp.

References AABB_STRING, AABB::asIntString(), Edict::classname, Com_DPrintf(), DEBUG_GAME, Edict::destroy, Destroy_Breakable(), Edict::entBox, ET_BREAKABLE, FL_DESTROYABLE, Edict::flags, gi, Edict::mapNum, Edict::model, Edict::origin, Edict::setTouch(), Edict::solid, SOLID_BSP, Touch_Breakable(), Edict::type, Edict::use, and Use_Breakable().

◆ SP_func_door()

◆ SP_func_door_sliding()

◆ SP_func_rotating()

void SP_func_rotating ( Edict * ent)

Spawns a rotating solid inline brush model.

See also
SV_SetModel
LM_AddModel

Definition at line 405 of file g_func.cpp.

References Edict::classname, Edict::destroy, Destroy_Breakable(), ET_ROTATING, FL_DESTROYABLE, Edict::flags, gi, Edict::HP, Edict::model, Edict::solid, SOLID_BSP, Edict::speed, and Edict::type.

◆ Touch_Breakable()

bool Touch_Breakable ( Edict * self,
Edict * 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
selfThe breakable edict
activatorThe 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
Todo
check that the actor is standing upon the breakable

Definition at line 46 of file g_func.cpp.

References G_IsActor, and G_TriggerAddToList().

Referenced by SP_func_breakable().

◆ Touch_DoorTrigger()

bool Touch_DoorTrigger ( Edict * self,
Edict * 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 290 of file g_func.cpp.

References AI_CheckUsingDoor(), FL_GROUPSLAVE, Edict::flags, G_ActorSetClientAction(), G_ActorUseDoor(), G_IsActor, G_IsAI, Edict::groupMaster, Edict::inuse, makeActor(), and Edict::owner().

Referenced by SP_func_door().

◆ Use_Breakable()

bool Use_Breakable ( Edict * self,
Edict * activator )
static

Definition at line 127 of file g_func.cpp.

References Destroy_Breakable(), and Edict::HP.

Referenced by SP_func_breakable().