Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
disablerelay.qc
Go to the documentation of this file.
1
#include "
disablerelay.qh
"
2
#ifdef SVQC
3
void
trigger_disablerelay_use
(
entity
this
,
entity
actor,
entity
trigger)
4
{
5
if
(this.
active
!=
ACTIVE_ACTIVE
)
6
return
;
7
8
int
a = 0, b = 0;
9
10
for
(
entity
e =
NULL
; (e =
find
(e,
targetname
, this.
target
)); )
11
{
12
if
(e.active ==
ACTIVE_ACTIVE
)
13
{
14
e.active =
ACTIVE_NOT
;
15
++a;
16
}
17
else
if
(e.active ==
ACTIVE_NOT
)
18
{
19
e.active =
ACTIVE_ACTIVE
;
20
++b;
21
}
22
}
23
24
if
((!a) == (!b))
25
LOG_INFO
(
"Invalid use of trigger_disablerelay: "
,
ftos
(a),
" relays were on, "
,
ftos
(b),
" relays were off!"
);
26
}
27
28
spawnfunc
(trigger_disablerelay)
29
{
30
this.reset = spawnfunc_trigger_disablerelay;
// this spawnfunc resets fully
31
this.
active
=
ACTIVE_ACTIVE
;
32
this.
use
=
trigger_disablerelay_use
;
33
}
34
#endif
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
use
#define use
Definition
csprogsdefs.qh:50
ACTIVE_NOT
const int ACTIVE_NOT
Definition
defs.qh:36
active
int active
Definition
defs.qh:34
ACTIVE_ACTIVE
const int ACTIVE_ACTIVE
Definition
defs.qh:37
trigger_disablerelay_use
void trigger_disablerelay_use(entity this, entity actor, entity trigger)
Definition
disablerelay.qc:3
disablerelay.qh
LOG_INFO
#define LOG_INFO(...)
Definition
log.qh:65
find
entity find(entity start,.string field, string match)
ftos
string ftos(float f)
NULL
#define NULL
Definition
post.qh:14
spawnfunc
#define spawnfunc(id)
Definition
spawnfunc.qh:96
targetname
string targetname
Definition
triggers.qh:56
target
string target
Definition
triggers.qh:55
common
mapobjects
trigger
disablerelay.qc
Generated on
for Xonotic QuakeC by
1.14.0