#include <client/shownames.qh>
#include <client/view.qh>
#include <client/weapons/projectile.qh>
+#include <common/checkextension.qh>
#include <common/deathtypes/all.qh>
#include <common/effects/all.inc>
#include <common/effects/all.qh>
LOG_TRACEF("^4CSQC Build information: ^1%s", WATERMARK);
#endif
+ CheckEngineExtensions();
+
{
int i = 0;
for ( ; i < 255; ++i)
noref float autocvar_net_connecttimeout = 30;
+#include "checkextension.qc"
+
#ifdef GAMEQC
#include "anim.qc"
#include "animdecide.qc"
--- /dev/null
+#include "checkextension.qh"
+
+void CheckEngineExtensions(void)
+{
+ if (!cvar("pr_checkextension"))
+ LOG_FATAL("Engine lacks the QC extension system.");
+
+ if (!checkextension("DP_QC_URI_GET") || !checkextension("DP_QC_URI_POST"))
+ LOG_WARN("Engine lacks HTTP support, XonStat and map downloads are unavailable.");
+
+ if (!checkextension("DP_CRYPTO"))
+ 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"))
+ {
+ 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
+ nudgeoutofsolid = WarpZoneLib_MoveOutOfSolid;
+ }
+#endif
+
+ // TODO: add proper warns/errors for other extensions we depend on
+}
--- /dev/null
+#pragma once
+
+void CheckEngineExtensions(void);
}
}
-bool WarpZoneLib_MoveOutOfSolid(entity e)
+int WarpZoneLib_MoveOutOfSolid(entity e)
{
vector o = e.origin;
traceline(o, o, MOVE_WORLDONLY, e);
if (trace_startsolid)
- return false;
+ return 0; // too stuck, giving up
tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
if (!trace_startsolid)
- return true;
+ return -1; // wasn't stuck
vector m0 = e.mins;
vector m1 = e.maxs;
if (trace_startsolid)
{
setorigin(e, o);
- return false;
+ return 0; // can't fix
}
- return true;
+ return 1; // was stuck but is fixed now
}
#ifndef BITXOR_ASSIGN
# define BITXOR_ASSIGN(a,b) ((a) = ((a) | (b)) - ((a) & (b)))
#endif
-bool WarpZoneLib_MoveOutOfSolid(entity e);
+int WarpZoneLib_MoveOutOfSolid(entity e);
#define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher, bool touchfunc);
#pragma once
-bool WarpZoneLib_MoveOutOfSolid(entity e);
#ifdef SVQC
void WarpZoneLib_ExactTrigger_Init(entity this, bool unsetmodel);
#endif
#include "xonotic/util.qh"
+#include <common/checkextension.qh>
#include <common/items/_mod.qh>
#include <common/weapons/_all.qh>
#include <common/mapinfo.qh>
LOG_TRACEF("^4MQC Build information: ^1%s", WATERMARK);
#endif
+ CheckEngineExtensions();
+
// list all game dirs (TEST)
if (cvar("developer") > 0)
{
#include "world.qh"
+#include <common/checkextension.qh>
#include <common/constants.qh>
#include <common/deathtypes/all.qh>
#include <common/gamemodes/_mod.qh>
bool world_already_spawned;
spawnfunc(worldspawn)
{
+ CheckEngineExtensions();
+
cvar_set("_endmatch", "0");
server_is_dedicated = boolean(stof(cvar_defstring("is_dedicated")));