]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/relay_activators.qc
Merge branch 'master' into terencehill/glowmod_color_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / relay_activators.qc
1 #include "relay_activators.qh"
2
3 #ifdef SVQC
4 void 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
21 void relay_activators_init(entity this)
22 {
23         this.reset = relay_activators_init; // doubles as a reset function
24         this.active = ACTIVE_ACTIVE;
25         this.use = relay_activators_use;
26 }
27
28 spawnfunc(relay_activate)
29 {
30         this.cnt = ACTIVE_ACTIVE;
31         relay_activators_init(this);
32 }
33
34 spawnfunc(relay_deactivate)
35 {
36         this.cnt = ACTIVE_NOT;
37         relay_activators_init(this);
38 }
39
40 spawnfunc(relay_activatetoggle)
41 {
42         this.cnt = ACTIVE_TOGGLE;
43         relay_activators_init(this);
44 }
45 #endif