Xonotic
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
18
void
defer_think(
entity
this
)
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;
34
setthink
(e, defer_think);
35
e.nextthink =
time
+ fdelay;
36
}
37
38
#endif
entity
entity() spawn
classfield
#define classfield(name)
Definition:
oo.qh:52
owner
entity owner
Definition:
main.qh:73
oo.qh
self.qh
nextthink
float nextthink
Definition:
csprogsdefs.qc:121
new_pure
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition:
oo.qh:62
setthink
#define setthink(e, f)
entityclass
#define entityclass(...)
Definition:
oo.qh:47
time
float time
Definition:
csprogsdefs.qc:16
lib
defer.qh
Generated on Thu Mar 17 2022 17:26:29 for Xonotic by
1.8.13