Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
defer.qh
Go to the documentation of this file.
1#pragma once
2
3#ifdef GAMEQC
4 #include "oo.qh"
5 #include "self.qh"
6
7 entityclass(Defer);
8 classfield(Defer).entity owner;
9 classfield(Defer).void(entity) defer_func;
10
12 void SUB_Remove(entity this)
13 {
14 delete(this);
15 }
16
18 {
19 setthink(this, SUB_Remove);
20 this.nextthink = time;
21 this.defer_func(this.owner);
22 }
23
26 void defer(entity this, float fdelay, void(entity) func)
27 {
28 entity e = new_pure(deferred);
29 e.owner = this;
30 e.defer_func = func;
32 e.nextthink = time + fdelay;
33 }
34#endif // GAMEQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
float time
float nextthink
void defer(entity this, float fdelay, void(entity) func)
Execute func() after time + fdelay.
Definition defer.qh:26
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:12
void defer_think(entity this)
Definition defer.qh:17
#define entityclass(...)
Definition oo.qh:51
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66
#define classfield(name)
Definition oo.qh:56
#define setthink(e, f)