Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
relay_activators.qc
Go to the documentation of this file.
1#include "relay_activators.qh"
2
3#ifdef SVQC
4void relay_activators_use(entity this, entity actor, entity trigger)
5{
6 if(this.active != ACTIVE_ACTIVE)
7 return;
8
9 for(entity trg = NULL; (trg = find(trg, targetname, this.target)); )
10 {
11 if (trg.setactive)
12 trg.setactive(trg, this.cnt);
13 else
14 {
15 //bprint("Not using setactive\n");
16 generic_setactive(trg, this.cnt);
17 }
18 }
19}
20
22{
23 this.reset = relay_activators_init; // doubles as a reset function
24 this.active = ACTIVE_ACTIVE;
26}
27
28spawnfunc(relay_activate)
29{
30 this.cnt = ACTIVE_ACTIVE;
32}
33
34spawnfunc(relay_deactivate)
35{
36 this.cnt = ACTIVE_NOT;
38}
39
40spawnfunc(relay_activatetoggle)
41{
42 this.cnt = ACTIVE_TOGGLE;
44}
45#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cnt
Definition powerups.qc:24
#define use
const int ACTIVE_TOGGLE
Definition defs.qh:40
const int ACTIVE_NOT
Definition defs.qh:36
int active
Definition defs.qh:34
const int ACTIVE_ACTIVE
Definition defs.qh:37
entity find(entity start,.string field, string match)
#define NULL
Definition post.qh:14
void relay_activators_use(entity this, entity actor, entity trigger)
void relay_activators_init(entity this)
#define spawnfunc(id)
Definition spawnfunc.qh:96
void generic_setactive(entity this, int act)
Definition triggers.qc:46
string targetname
Definition triggers.qh:56
string target
Definition triggers.qh:55