Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
relay_if.qc File Reference
#include "relay_if.qh"
Include dependency graph for relay_if.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 spawnfunc (trigger_relay_if)
void trigger_relay_if_use (entity this, entity actor, entity trigger)

Function Documentation

◆ spawnfunc()

spawnfunc ( trigger_relay_if )

Definition at line 20 of file relay_if.qc.

21{
22 this.reset = spawnfunc_trigger_relay_if; // this spawnfunc resets fully
23 this.active = ACTIVE_ACTIVE;
25}
#define use
int active
Definition defs.qh:34
const int ACTIVE_ACTIVE
Definition defs.qh:37
void trigger_relay_if_use(entity this, entity actor, entity trigger)
Definition relay_if.qc:4

References active, ACTIVE_ACTIVE, trigger_relay_if_use(), and use.

◆ trigger_relay_if_use()

void trigger_relay_if_use ( entity this,
entity actor,
entity trigger )

Definition at line 4 of file relay_if.qc.

5{
6 if(this.active != ACTIVE_ACTIVE)
7 return;
8
9 int n = this.count;
10
11 // TODO make this generic AND faster than nextent()ing through all, if somehow possible
12 n = (cvar_string(this.netname) == cvar_string(this.message));
13 if(this.spawnflags & RELAYIF_NEGATE)
14 n = !n;
15
16 if(n)
17 SUB_UseTargets(this, actor, trigger);
18}
string netname
Definition powerups.qc:20
string message
Definition powerups.qc:19
float count
Definition powerups.qc:22
int spawnflags
Definition ammo.qh:15
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition triggers.qc:344
const string cvar_string(string name)
const int RELAYIF_NEGATE
Definition relay_if.qh:4

References active, ACTIVE_ACTIVE, count, cvar_string(), entity(), message, netname, RELAYIF_NEGATE, spawnflags, and SUB_UseTargets().

Referenced by spawnfunc().