]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/delay.qc
Merge branch 'master' into martin-t/dmgtext
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / delay.qc
1 #include "delay.qh"
2 #ifdef SVQC
3 void delay_delayeduse(entity this)
4 {
5         SUB_UseTargets(this, this.enemy, this.goalentity);
6         this.enemy = this.goalentity = NULL;
7 }
8
9 void delay_use(entity this, entity actor, entity trigger)
10 {
11         this.enemy = actor;
12         this.goalentity = trigger;
13         setthink(this, delay_delayeduse);
14         this.nextthink = time + this.wait;
15 }
16
17 void delay_reset(entity this)
18 {
19         this.enemy = this.goalentity = NULL;
20         setthink(this, func_null);
21         this.nextthink = 0;
22 }
23
24 spawnfunc(trigger_delay)
25 {
26     if(!this.wait)
27         this.wait = 1;
28
29     this.use = delay_use;
30     this.reset = delay_reset;
31 }
32 #endif