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
5 #include "oo.qh"
6 #include "self.qh"
7
8 entityclass(Defer);
9 classfield(Defer).entity owner;
10 classfield(Defer).void(entity) defer_func;
11
13 void SUB_Remove(entity this)
14 {
15 delete(this);
16 }
17
19 {
20 setthink(this, SUB_Remove);
21 this.nextthink = time;
22 this.defer_func(this.owner);
23 }
24
29 void defer(entity this, float fdelay, void(entity) func)
30 {
31 entity e = new_pure(deferred);
32 e.owner = this;
33 e.defer_func = func;
35 e.nextthink = time + fdelay;
36 }
37
38#endif
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:29
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:13
void defer_think(entity this)
Definition defer.qh:18
#define entityclass(...)
Definition oo.qh:52
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67
#define classfield(name)
Definition oo.qh:57
#define setthink(e, f)