Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
checkextension.qc File Reference
#include "checkextension.qh"
Include dependency graph for checkextension.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void CheckEngineExtensions (void)
entity findbox_Fallback (vector mins, vector maxs)
entity findbox_tofield_Fallback (vector mins, vector maxs,.entity tofield)

Function Documentation

◆ CheckEngineExtensions()

void CheckEngineExtensions ( void )

Definition at line 30 of file checkextension.qc.

31{
32 if (!cvar("pr_checkextension"))
33 LOG_FATAL("Engine lacks the QC extension system.");
34
35 if (!checkextension("DP_QC_URI_GET") || !checkextension("DP_QC_URI_POST"))
36 LOG_WARN("Engine lacks HTTP support, XonStat and map downloads are unavailable.");
37
38 if (!checkextension("DP_CRYPTO"))
39 LOG_WARN("Engine lacks DP_CRYPTO, Player IDs (required for XonStat, CTS/CTF records and pubkey authentication) are unavailable.");
40
41#ifdef SVQC // change to GAMEQC if/when we use nudgeoutofsolid in CSQC
42 if (checkextension("DP_QC_NUDGEOUTOFSOLID"))
43 {
44 nudgeoutofsolid_OrFallback = nudgeoutofsolid;
45 }
46 else
47 {
48 LOG_WARN("Engine lacks DP_QC_NUDGEOUTOFSOLID, falling back to WarpZoneLib_MoveOutOfSolid().");
49 // DP_QC_NUDGEOUTOFSOLID fixes many cases WarpZoneLib_MoveOutOfSolid() can't, usually in less CPU time
50 nudgeoutofsolid_OrFallback = WarpZoneLib_MoveOutOfSolid;
51 }
52
53 if (!world.fullspawndata)
54 LOG_WARN("Engine lacks entity fullspawndata, on Quake 3 maps some entities will malfunction.");
55
56 if (!checkextension("DP_RM_CLIPGROUP"))
57 LOG_WARN("Engine lacks DP_RM_CLIPGROUP, g_projectiles_interact < 2 won't take effect.");
58#endif
59
60#ifdef GAMEQC
61 if (checkextension("DP_QC_FINDBOX"))
62 {
63 findbox_OrFallback = findbox;
64 findbox_tofield_OrFallback = findbox_tofield;
65 }
66 else
67 {
68 LOG_WARN("Engine lacks DP_QC_FINDBOX, performance will be suboptimal.");
69 findbox_OrFallback = findbox_Fallback;
70 findbox_tofield_OrFallback = findbox_tofield_Fallback;
71 }
72#endif
73
74 // TODO: add proper warns/errors for other extensions we depend on
75}
entity findbox_tofield_Fallback(vector mins, vector maxs,.entity tofield)
entity findbox_Fallback(vector mins, vector maxs)
int WarpZoneLib_MoveOutOfSolid(entity e)
Definition common.qc:848
#define LOG_FATAL(...)
Definition log.qh:53
#define LOG_WARN(...)
Definition log.qh:61
float cvar(string name)
float checkextension(string ext)
#define world
Definition post.qh:15

References checkextension(), cvar(), findbox_Fallback(), findbox_tofield_Fallback(), LOG_FATAL, LOG_WARN, WarpZoneLib_MoveOutOfSolid(), and world.

Referenced by CSQC_Init(), m_init(), and spawnfunc().

◆ findbox_Fallback()

entity findbox_Fallback ( vector mins,
vector maxs )

Definition at line 24 of file checkextension.qc.

25{
27}
vector mins
entity chain
vector maxs

References chain, entity(), findbox_tofield_Fallback(), maxs, mins, and vector.

Referenced by CheckEngineExtensions().

◆ findbox_tofield_Fallback()

entity findbox_tofield_Fallback ( vector mins,
vector maxs,
.entity tofield )

Definition at line 4 of file checkextension.qc.

5{
6 // 0.03125 minimum radius because findradius returns no results if radius is zero
7 // but findbox for a zero-sized box returns entities touching the specified point
8 entity chain = findradius_tofield(0.5 * (mins + maxs), max(0.03125, 0.5 * vlen(maxs - mins)), tofield);
10 for (entity e = chain; e; e = e.tofield)
11 {
12 if (boxesoverlap(e.absmin, e.absmax, mins, maxs))
13 prev = e;
14 else // not in box so remove from chain
15 {
16 if (prev)
17 prev.tofield = e.tofield;
18 else
19 chain = chain.tofield;
20 }
21 }
22 return chain;
23}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
prev
Definition all.qh:71
float vlen(vector v)
float max(float f,...)
#define NULL
Definition post.qh:14
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
Definition vector.qh:73

References boxesoverlap(), chain, entity(), max(), maxs, mins, NULL, prev, vector, and vlen().

Referenced by CheckEngineExtensions(), and findbox_Fallback().