2 #define COMPAT_NO_MOD_IS_XONOTIC
7 #ifndef QCC_SUPPORT_INT
11 #ifndef QCC_SUPPORT_BOOL
15 #include <dpdefs/pre.qh>
18 #include <dpdefs/csprogsdefs.qh>
19 #include <dpdefs/keycodes.qh>
21 #include <server/sys-pre.qh>
22 #include <dpdefs/progsdefs.qh>
23 #include <dpdefs/dpextensions.qh>
24 #include <server/sys-post.qh>
26 #include <dpdefs/menudefs.qh>
27 #include <dpdefs/keycodes.qh>
30 #include <dpdefs/post.qh>
34 #define USING(name, T) typedef T name
42 #define TC(T, sym) MACRO_BEGIN MACRO_END
44 #define TC(T, sym) MACRO_BEGIN \
46 LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
52 #define is_float(this) (true || ftoe(this))
53 #define isnt_float(this)
54 #define is_vector(this) (true || vtos(this))
55 #define isnt_vector(this)
56 #define is_string(this) (true || stof(this))
57 #define isnt_string(this)
58 #define is_entity(this) (true || etof(this))
59 #define isnt_entity(this)
60 bool is_int(float this) { return this == floor(this); }
61 void isnt_int(float this) { print(ftos(this)); }
62 bool is_bool(float this) { return this == true || this == false; }
63 void isnt_bool(float this) { print(ftos(this)); }
65 #include "warpzone/mathlib.qc"
67 #include "accumulate.qh"
69 #include "arraylist.qh"
72 #include "counting.qh"
76 #include "enumclass.qh"
78 #include "functional.qh"
80 #include "intrusivelist.qh"
84 #include "linkedlist.qh"
87 #include "markdown.qh"
94 #include "p2mathlib.qc"
95 #include "progname.qh"
97 #include "registry.qh"
98 #include "registry_net.qh"
99 #include "replicate.qh"
100 #include "sortlist.qc"
102 #include "spawnfunc.qh"
113 #include "matrix/_mod.inc"
116 #define objerror_safe(e)
118 void make_safe_for_remove(entity this);
119 #define objerror_safe(e) make_safe_for_remove(e)
122 #define objerror(this, msg) MACRO_BEGIN { \
123 LOG_WARNING("======OBJECT ERROR======"); \
124 entity _e = (this); \
128 LOG_WARNINGF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
133 void m_init() { if (_m_init) _m_init(); }
134 #define m_init _m_init
137 void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
138 #define m_shutdown _m_shutdown
140 void _m_draw(float width, float height);
141 void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
142 #define m_draw _m_draw
144 void _m_keydown(int keynr, int ascii);
145 void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
146 #define m_keydown _m_keydown
148 void _m_toggle(int mode);
149 void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
150 #define m_toggle _m_toggle
155 void main() { if (_main) _main(); }
159 void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
160 #define SV_Shutdown _SV_Shutdown
163 void StartFrame() { if (_StartFrame) _StartFrame(); }
164 #define StartFrame _StartFrame
167 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
168 #define SetNewParms _SetNewParms
170 void _SetChangeParms(entity this);
171 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
172 #define SetChangeParms _SetChangeParms
174 void _ClientConnect(entity this);
175 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
176 #define ClientConnect _ClientConnect
178 void _ClientDisconnect(entity this);
179 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
180 #define ClientDisconnect _ClientDisconnect
182 void _PutClientInServer(entity this);
183 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
184 #define PutClientInServer _PutClientInServer
186 void _ClientKill(entity this);
187 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
188 #define ClientKill _ClientKill
190 void _PlayerPreThink(entity this);
191 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
192 #define PlayerPreThink _PlayerPreThink
194 void _PlayerPostThink(entity this);
195 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
196 #define PlayerPostThink _PlayerPostThink
198 void _SV_PlayerPhysics(entity this);
199 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
200 #define SV_PlayerPhysics _SV_PlayerPhysics
202 void _SV_OnEntityPreSpawnFunction(entity this);
203 void SV_OnEntityPreSpawnFunction()
206 if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
208 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
210 void _SV_ChangeTeam(entity this, int _color);
211 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
212 #define SV_ChangeTeam _SV_ChangeTeam
214 void _SV_ParseClientCommand(entity this, string command);
215 void SV_ParseClientCommand(string command)
218 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
220 #define SV_ParseClientCommand _SV_ParseClientCommand
225 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
226 #define CSQC_Init _CSQC_Init
228 void _CSQC_Shutdown();
229 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
230 #define CSQC_Shutdown _CSQC_Shutdown
232 void _CSQC_UpdateView(entity this, float w, float h);
233 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
234 #define CSQC_UpdateView _CSQC_UpdateView
236 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
237 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
239 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
241 #define CSQC_InputEvent _CSQC_InputEvent
243 bool _CSQC_ConsoleCommand(string s);
244 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
245 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
247 void _CSQC_Ent_Update(entity this, bool isNew);
248 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
249 #define CSQC_Ent_Update _CSQC_Ent_Update
251 void _CSQC_Ent_Remove(entity this);
252 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
253 #define CSQC_Ent_Remove _CSQC_Ent_Remove