Xonotic
relay_activators.qc
Go to the documentation of this file.
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
relay_activators.qh
ACTIVE_TOGGLE
const int ACTIVE_TOGGLE
Definition:
defs.qh:40
entity
entity() spawn
spawnfunc
spawnfunc(info_player_attacker)
Definition:
sv_assault.qc:283
cnt
float cnt
Definition:
powerups.qc:24
ACTIVE_ACTIVE
const int ACTIVE_ACTIVE
Definition:
defs.qh:37
NULL
#define NULL
Definition:
post.qh:17
find
entity find(entity start,.string field, string match)
targetname
string targetname
Definition:
progsdefs.qc:194
active
int active
Definition:
defs.qh:34
use
#define use
Definition:
csprogsdefs.qh:50
target
string target
Definition:
progsdefs.qc:193
ACTIVE_NOT
const int ACTIVE_NOT
Definition:
defs.qh:36
common
mapobjects
trigger
relay_activators.qc
Generated on Thu Mar 17 2022 17:26:28 for Xonotic by
1.8.13