1 #include "checkextension.qh"
4 entity findbox_tofield_Fallback(vector mins, vector maxs, .entity tofield)
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)
12 if (boxesoverlap(e.absmin, e.absmax, mins, maxs))
14 else // not in box so remove from chain
17 prev.tofield = e.tofield;
19 chain = chain.tofield;
24 entity findbox_Fallback(vector mins, vector maxs)
26 return findbox_tofield_Fallback(mins, maxs, chain);
30 void CheckEngineExtensions(void)
32 if (!cvar("pr_checkextension"))
33 LOG_FATAL("Engine lacks the QC extension system.");
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.");
38 if (!checkextension("DP_CRYPTO"))
39 LOG_WARN("Engine lacks DP_CRYPTO, Player IDs (required for XonStat and CTS/CTF records) are unavailable.");
41 #ifdef SVQC // change to GAMEQC if/when we use nudgeoutofsolid in CSQC
42 if (!checkextension("DP_QC_NUDGEOUTOFSOLID"))
44 LOG_WARN("Engine lacks DP_QC_NUDGEOUTOFSOLID, falling back to WarpZoneLib_MoveOutOfSolid().");
45 // DP_QC_NUDGEOUTOFSOLID fixes many cases WarpZoneLib_MoveOutOfSolid() can't, usually in less CPU time
46 nudgeoutofsolid = WarpZoneLib_MoveOutOfSolid;
51 if (!checkextension("DP_QC_FINDBOX"))
53 LOG_WARN("Engine lacks DP_QC_FINDBOX, performance will be suboptimal.");
54 findbox = findbox_Fallback;
55 findbox_tofield = findbox_tofield_Fallback;
59 // TODO: add proper warns/errors for other extensions we depend on