LOG_WARN("Engine lacks DP_CRYPTO, Player IDs (required for XonStat and CTS/CTF records) are unavailable.");
#ifdef SVQC // change to GAMEQC if/when we use nudgeoutofsolid in CSQC
- if (!checkextension("DP_QC_NUDGEOUTOFSOLID"))
+ if (checkextension("DP_QC_NUDGEOUTOFSOLID"))
+ {
+ nudgeoutofsolid_CheckedEngineExtensions_usebuiltin();
+ }
+ else
{
LOG_WARN("Engine lacks DP_QC_NUDGEOUTOFSOLID, falling back to WarpZoneLib_MoveOutOfSolid().");
// DP_QC_NUDGEOUTOFSOLID fixes many cases WarpZoneLib_MoveOutOfSolid() can't, usually in less CPU time
#endif
#ifdef GAMEQC
- if (!checkextension("DP_QC_FINDBOX"))
+ if (checkextension("DP_QC_FINDBOX"))
+ {
+ findbox_CheckedEngineExtensions_usebuiltin();
+ findbox_tofield_CheckedEngineExtensions_usebuiltin();
+ }
+ else
{
LOG_WARN("Engine lacks DP_QC_FINDBOX, performance will be suboptimal.");
findbox = findbox_Fallback;
#pragma once
-// For some reason, GMQCC _requires_ this code to overwrite builtin globals,
-// while FTEQCC bans the same. Fine...
-#ifndef GMQCC
+// TODO: when https://github.com/graphitemaster/gmqcc/issues/211 is fixed,
+// remove the _usebuiltin functions and pre-initialize the variables directly.
+// Doing so already works in FTEQCC but not in GMQCC.
+//
+// The _usebuiltin functions are declared here so that the preprocessors based
+// remapping does not impact them yet.
#ifdef GAMEQC
-var entity(vector mins, vector maxs, .entity tofield) findbox_tofield_CheckedEngineExtensions = findbox_tofield;
+var entity(vector mins, vector maxs, .entity tofield) findbox_tofield_CheckedEngineExtensions;
+void findbox_tofield_CheckedEngineExtensions_usebuiltin() {
+ findbox_tofield_CheckedEngineExtensions = findbox_tofield;
+}
#define findbox_tofield findbox_tofield_CheckedEngineExtensions
-var entity(vector mins, vector maxs) findbox_CheckedEngineExtensions = findbox;
+var entity(vector mins, vector maxs) findbox_CheckedEngineExtensions;
+void findbox_CheckedEngineExtensions_usebuiltin() {
+ findbox_CheckedEngineExtensions = findbox;
+}
#define findbox findbox_CheckedEngineExtensions
#endif
#ifdef SVQC // change to GAMEQC if/when we use nudgeoutofsolid in CSQC
-var float(entity ent) nudgeoutofsolid_CheckedEngineExtensions = nudgeoutofsolid;
+var float(entity ent) nudgeoutofsolid_CheckedEngineExtensions;
+void nudgeoutofsolid_CheckedEngineExtensions_usebuiltin() {
+ nudgeoutofsolid_CheckedEngineExtensions = nudgeoutofsolid;
+}
#define nudgeoutofsolid nudgeoutofsolid_CheckedEngineExtensions
#endif
-#endif
-
void CheckEngineExtensions(void);