From b0a563c3658ec620ddb9037b9417b743a47002a5 Mon Sep 17 00:00:00 2001
From: Mario <mario@smbclan.net>
Date: Sun, 23 Oct 2016 14:26:38 +1000
Subject: [PATCH] Make it compile without XONOTIC defined

---
 qcsrc/Makefile                                |  2 +-
 qcsrc/client/hud/panel/scoreboard.qc          |  1 +
 qcsrc/client/progs.inc                        |  2 +-
 qcsrc/client/shownames.qc                     |  1 +
 qcsrc/client/view.qc                          |  1 +
 qcsrc/client/weapons/projectile.qc            |  1 +
 qcsrc/common/constants.qh                     | 55 ------------------
 qcsrc/common/net_linked.qh                    | 56 +++++++++++++++++++
 qcsrc/common/notifications/all.qc             |  1 +
 qcsrc/common/triggers/target/music.qc         |  1 +
 qcsrc/lib/_all.inc                            |  2 +
 qcsrc/lib/csqcmodel/cl_player.qc              |  1 +
 qcsrc/lib/csqcmodel/sv_model.qc               |  1 +
 qcsrc/lib/draw.qh                             |  3 +-
 qcsrc/lib/matrix/_mod.inc                     |  4 +-
 qcsrc/lib/matrix/_mod.qh                      |  4 +-
 qcsrc/lib/net.qh                              |  3 +-
 qcsrc/lib/warpzone/server.qc                  |  2 +-
 qcsrc/server/bot/default/bot.qc               |  1 +
 qcsrc/server/bot/default/havocbot/havocbot.qc |  1 +
 qcsrc/server/bot/default/navigation.qc        |  1 +
 qcsrc/server/bot/default/waypoints.qc         |  1 +
 qcsrc/server/command/getreplies.qc            |  1 +
 qcsrc/server/command/sv_cmd.qc                |  1 +
 qcsrc/server/command/vote.qc                  |  1 +
 qcsrc/server/progs.inc                        |  2 +-
 qcsrc/server/weapons/accuracy.qc              |  1 +
 qcsrc/server/weapons/common.qc                |  1 +
 qcsrc/server/weapons/csqcprojectile.qc        |  1 +
 qcsrc/server/weapons/selection.qc             |  1 +
 qcsrc/server/weapons/tracing.qc               |  1 +
 qcsrc/server/weapons/weaponsystem.qc          |  1 +
 32 files changed, 92 insertions(+), 64 deletions(-)
 create mode 100644 qcsrc/common/net_linked.qh

diff --git a/qcsrc/Makefile b/qcsrc/Makefile
index 903d8537e6..916fe08c9b 100644
--- a/qcsrc/Makefile
+++ b/qcsrc/Makefile
@@ -7,7 +7,7 @@ WORKDIR ?= ../.tmp
 QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
 NDEBUG ?= 1
-XONOTIC ?= 1
+XONOTIC ?= 0
 BUILD_MOD ?=
 
 ifndef ZIP
diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc
index 117badbec4..ef68e21b20 100644
--- a/qcsrc/client/hud/panel/scoreboard.qc
+++ b/qcsrc/client/hud/panel/scoreboard.qc
@@ -3,6 +3,7 @@
 #include "quickmenu.qh"
 #include <common/ent_cs.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/minigames/cl_minigames.qh>
 #include <common/stats.qh>
diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc
index 327df77c25..738831a5d0 100644
--- a/qcsrc/client/progs.inc
+++ b/qcsrc/client/progs.inc
@@ -2,9 +2,9 @@
 
 #if XONOTIC
 #include <client/_all.inc>
-#endif
 
 #include <ecs/_mod.inc>
+#endif
 
 #ifdef BUILD_MOD
 #include <mod/client/progs.inc>
diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc
index 75ef40521e..6a4515ac14 100644
--- a/qcsrc/client/shownames.qc
+++ b/qcsrc/client/shownames.qc
@@ -4,6 +4,7 @@
 
 #include <common/ent_cs.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/teams.qh>
 
diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc
index 3134a24ed2..d309f4d9a7 100644
--- a/qcsrc/client/view.qc
+++ b/qcsrc/client/view.qc
@@ -13,6 +13,7 @@
 #include <common/ent_cs.qh>
 #include <common/anim.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/debug.qh>
 #include <common/mapinfo.qh>
 #include <common/gamemodes/_mod.qh>
diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc
index 6d58ac77a2..1f88bc8d60 100644
--- a/qcsrc/client/weapons/projectile.qc
+++ b/qcsrc/client/weapons/projectile.qc
@@ -6,6 +6,7 @@
 #include "../mutators/events.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/physics/movetypes/movetypes.qh>
 
 #include <lib/csqcmodel/interpolate.qh>
diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh
index 29f96aa449..133d0caca3 100644
--- a/qcsrc/common/constants.qh
+++ b/qcsrc/common/constants.qh
@@ -1,60 +1,5 @@
 #pragma once
 
-REGISTER_NET_TEMP(TE_CSQC_PICTURE)
-REGISTER_NET_TEMP(TE_CSQC_RACE)
-REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER)
-REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT)
-REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
-REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
-
-const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
-const int RACE_NET_CHECKPOINT_CLEAR = 1;
-const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
-const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
-const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
-const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
-const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
-const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
-const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client
-const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
-const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
-const int RACE_NET_SERVER_RANKINGS = 11;
-const int RACE_NET_SERVER_STATUS = 12;
-const int RANKINGS_CNT = 15;
-
-REGISTER_NET_LINKED(_ENT_CLIENT_INIT)
-#ifdef CSQC
-NET_HANDLE(_ENT_CLIENT_INIT, bool isnew) { make_pure(this); return true; }
-#endif
-/** Sent as a temp entity from a persistent linked entity */
-REGISTER_NET_TEMP(ENT_CLIENT_INIT)
-
-REGISTER_NET_LINKED(ENT_CLIENT_SCORES_INFO)
-REGISTER_NET_LINKED(ENT_CLIENT_SCORES)
-REGISTER_NET_LINKED(ENT_CLIENT_TEAMSCORES)
-REGISTER_NET_LINKED(ENT_CLIENT_NAGGER) // flags [votecalledvote]
-REGISTER_NET_LINKED(ENT_CLIENT_RADARLINK) // flags [startorigin] [endorigin] [startcolor+16*endcolor]
-REGISTER_NET_LINKED(ENT_CLIENT_PROJECTILE)
-REGISTER_NET_LINKED(ENT_CLIENT_MAPVOTE)
-REGISTER_NET_LINKED(ENT_CLIENT_CLIENTDATA)
-REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED)
-REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY)
-REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS)
-
-REGISTER_NET_LINKED(ENT_CLIENT_MODEL)
-
-REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE)
-REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA)
-REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED)
-
-REGISTER_NET_LINKED(ENT_CLIENT_ARC_BEAM)
-REGISTER_NET_LINKED(ENT_CLIENT_HOOK)
-REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE)
-
-REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT)
-REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT)
-REGISTER_NET_LINKED(ENT_CLIENT_WALL)
-
 const int SPRITERULE_DEFAULT = 0;
 const int SPRITERULE_TEAMPLAY = 1;
 const int SPRITERULE_SPECTATOR = 2;
diff --git a/qcsrc/common/net_linked.qh b/qcsrc/common/net_linked.qh
new file mode 100644
index 0000000000..a67550aac9
--- /dev/null
+++ b/qcsrc/common/net_linked.qh
@@ -0,0 +1,56 @@
+#pragma once
+
+REGISTER_NET_TEMP(TE_CSQC_PICTURE)
+REGISTER_NET_TEMP(TE_CSQC_RACE)
+REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER)
+REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT)
+REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
+REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
+
+const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
+const int RACE_NET_CHECKPOINT_CLEAR = 1;
+const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
+const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
+const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
+const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
+const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
+const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
+const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client
+const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
+const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
+const int RACE_NET_SERVER_RANKINGS = 11;
+const int RACE_NET_SERVER_STATUS = 12;
+const int RANKINGS_CNT = 15;
+
+REGISTER_NET_LINKED(_ENT_CLIENT_INIT)
+#ifdef CSQC
+NET_HANDLE(_ENT_CLIENT_INIT, bool isnew) { make_pure(this); return true; }
+#endif
+/** Sent as a temp entity from a persistent linked entity */
+REGISTER_NET_TEMP(ENT_CLIENT_INIT)
+
+REGISTER_NET_LINKED(ENT_CLIENT_SCORES_INFO)
+REGISTER_NET_LINKED(ENT_CLIENT_SCORES)
+REGISTER_NET_LINKED(ENT_CLIENT_TEAMSCORES)
+REGISTER_NET_LINKED(ENT_CLIENT_NAGGER) // flags [votecalledvote]
+REGISTER_NET_LINKED(ENT_CLIENT_RADARLINK) // flags [startorigin] [endorigin] [startcolor+16*endcolor]
+REGISTER_NET_LINKED(ENT_CLIENT_PROJECTILE)
+REGISTER_NET_LINKED(ENT_CLIENT_MAPVOTE)
+REGISTER_NET_LINKED(ENT_CLIENT_CLIENTDATA)
+REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED)
+REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY)
+REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS)
+
+REGISTER_NET_LINKED(ENT_CLIENT_MODEL)
+
+REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE)
+REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA)
+REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED)
+
+REGISTER_NET_LINKED(ENT_CLIENT_ARC_BEAM)
+REGISTER_NET_LINKED(ENT_CLIENT_HOOK)
+REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE)
+
+REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT)
+REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT)
+REGISTER_NET_LINKED(ENT_CLIENT_WALL)
diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc
index dd5f3a164b..5cf3e1c6b1 100644
--- a/qcsrc/common/notifications/all.qc
+++ b/qcsrc/common/notifications/all.qc
@@ -4,6 +4,7 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
 	#include <common/constants.qh>
+	#include <common/net_linked.qh>
 	#include <common/teams.qh>
 	#include <server/autocvars.qh>
 	#include <server/constants.qh>
diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc
index 0fde9e0439..1f8cb00cb5 100644
--- a/qcsrc/common/triggers/target/music.qc
+++ b/qcsrc/common/triggers/target/music.qc
@@ -3,6 +3,7 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
     #include <common/constants.qh>
+    #include <common/net_linked.qh>
     #include <server/constants.qh>
     #include <server/defs.qh>
 #endif
diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc
index b6c3c9e01b..6408d6e3f2 100644
--- a/qcsrc/lib/_all.inc
+++ b/qcsrc/lib/_all.inc
@@ -266,6 +266,8 @@ void make_safe_for_remove(entity this);
 #endif
 #undef ENGINE_EVENT
 
+#if XONOTIC
 #ifdef GAMEQC
 	#include <ecs/_mod.qh>
 #endif
+#endif
diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc
index 4cc8458d51..66613b5322 100644
--- a/qcsrc/lib/csqcmodel/cl_player.qc
+++ b/qcsrc/lib/csqcmodel/cl_player.qc
@@ -28,6 +28,7 @@
 #include <client/defs.qh>
 #include <client/main.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/physics/player.qh>
 #include <common/stats.qh>
 #include <common/triggers/trigger/viewloc.qh>
diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc
index 0f8ef06ac8..dd8d5d33aa 100644
--- a/qcsrc/lib/csqcmodel/sv_model.qc
+++ b/qcsrc/lib/csqcmodel/sv_model.qc
@@ -24,6 +24,7 @@
 #include "common.qh"
 #include <common/animdecide.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/util.qh>
 #include <server/constants.qh>
 #include <server/defs.qh>
diff --git a/qcsrc/lib/draw.qh b/qcsrc/lib/draw.qh
index 698c926237..52583ff58a 100644
--- a/qcsrc/lib/draw.qh
+++ b/qcsrc/lib/draw.qh
@@ -5,8 +5,6 @@
 	#include "i18n.qh"
 	#include "vector.qh"
 
-	#include <client/defs.qh>
-
 	void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
 	{
 		// I want to draw a quad...
@@ -123,6 +121,7 @@
 		drawstring_builtin(position, text, theScale, rgb, theAlpha, flag);
 	}
 
+	float vid_conwidth; // TODO
 	void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
 	{
 		position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x);
diff --git a/qcsrc/lib/matrix/_mod.inc b/qcsrc/lib/matrix/_mod.inc
index 4854f092a0..d68dc7d968 100644
--- a/qcsrc/lib/matrix/_mod.inc
+++ b/qcsrc/lib/matrix/_mod.inc
@@ -1,3 +1,5 @@
 // generated file; do not modify
-#include <lib/matrix/command.qc>
+#if XONOTIC
+	#include <lib/matrix/command.qc>
+#endif
 #include <lib/matrix/matrix.qc>
diff --git a/qcsrc/lib/matrix/_mod.qh b/qcsrc/lib/matrix/_mod.qh
index 9658122972..c351afe8f7 100644
--- a/qcsrc/lib/matrix/_mod.qh
+++ b/qcsrc/lib/matrix/_mod.qh
@@ -1,3 +1,5 @@
 // generated file; do not modify
-#include <lib/matrix/command.qh>
+#if XONOTIC
+	#include <lib/matrix/command.qh>
+#endif
 #include <lib/matrix/matrix.qh>
diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh
index 30ab014ec9..f0a9e817dc 100644
--- a/qcsrc/lib/net.qh
+++ b/qcsrc/lib/net.qh
@@ -313,12 +313,13 @@ USING(Stream, int);
 		#define ReadInt48_t() vec3(ReadInt24_t(), ReadInt24_t(), 0)
 		#define ReadInt72_t() vec3(ReadInt24_t(), ReadInt24_t(), ReadInt24_t())
 
-		int _ReadSByte;
+		noref int _ReadSByte;
 		#define ReadSByte() (_ReadSByte = ReadByte(), (_ReadSByte & BIT(7) ? -128 : 0) + (_ReadSByte & BITS(7)))
 		#define ReadFloat() ReadCoord()
 		#define ReadVector() vec3(ReadFloat(), ReadFloat(), ReadFloat())
 		#define ReadVector2D() vec3(ReadFloat(), ReadFloat(), 0)
 
+		float servertime; // TODO
 		float ReadApproxPastTime()
 		{
 			float dt = ReadByte();
diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc
index 34ea2610de..2e660827aa 100644
--- a/qcsrc/lib/warpzone/server.qc
+++ b/qcsrc/lib/warpzone/server.qc
@@ -5,9 +5,9 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
 	#include <common/constants.qh>
+	#include <common/net_linked.qh>
 	#include <common/triggers/subs.qh>
 	#include <common/util.qh>
-	#include <server/command/_mod.qh>
 	#include <server/constants.qh>
 	#include <server/defs.qh>
 #endif
diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc
index bdde55b9aa..2a7478dee2 100644
--- a/qcsrc/server/bot/default/bot.qc
+++ b/qcsrc/server/bot/default/bot.qc
@@ -27,6 +27,7 @@
 
 #include <common/physics/player.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/teams.qh>
 #include <common/util.qh>
diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc
index 45051b6c27..56c36c0745 100644
--- a/qcsrc/server/bot/default/havocbot/havocbot.qc
+++ b/qcsrc/server/bot/default/havocbot/havocbot.qc
@@ -9,6 +9,7 @@
 #include "../waypoints.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/physics/player.qh>
 #include <common/state.qh>
 #include <common/items/_mod.qh>
diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc
index 17f61af141..7c71720c4c 100644
--- a/qcsrc/server/bot/default/navigation.qc
+++ b/qcsrc/server/bot/default/navigation.qc
@@ -10,6 +10,7 @@
 #include <common/items/_mod.qh>
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/triggers/trigger/jumppads.qh>
 
 .float speed;
diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc
index 5fb923799a..c83d0f63c5 100644
--- a/qcsrc/server/bot/default/waypoints.qc
+++ b/qcsrc/server/bot/default/waypoints.qc
@@ -10,6 +10,7 @@
 #include "../../antilag.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 
 #include <lib/warpzone/common.qh>
 #include <lib/warpzone/util_server.qh>
diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc
index 9380fc4cde..5017e81aba 100644
--- a/qcsrc/server/command/getreplies.qc
+++ b/qcsrc/server/command/getreplies.qc
@@ -5,6 +5,7 @@
 #include "../race.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/util.qh>
 
diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc
index a329ac9965..cbc65680a0 100644
--- a/qcsrc/server/command/sv_cmd.qc
+++ b/qcsrc/server/command/sv_cmd.qc
@@ -21,6 +21,7 @@
 #include "../mutators/_mod.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/notifications/all.qh>
 #include <common/teams.qh>
diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc
index 361f128443..d1cdb7e59d 100644
--- a/qcsrc/server/command/vote.qc
+++ b/qcsrc/server/command/vote.qc
@@ -13,6 +13,7 @@
 #include "../mutators/_mod.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/notifications/all.qh>
 #include <common/playerstats.qh>
diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc
index 1000a5105b..1a8ada45fe 100644
--- a/qcsrc/server/progs.inc
+++ b/qcsrc/server/progs.inc
@@ -2,9 +2,9 @@
 
 #if XONOTIC
 #include <server/_all.inc>
-#endif
 
 #include <ecs/_mod.inc>
+#endif
 
 #ifdef BUILD_MOD
 #include <mod/server/progs.inc>
diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc
index ed9006bb25..7cc06da3e6 100644
--- a/qcsrc/server/weapons/accuracy.qc
+++ b/qcsrc/server/weapons/accuracy.qc
@@ -2,6 +2,7 @@
 
 #include "../mutators/_mod.qh"
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/teams.qh>
 #include <common/util.qh>
 #include <common/weapons/_all.qh>
diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc
index 03031c1580..6d16375506 100644
--- a/qcsrc/server/weapons/common.qc
+++ b/qcsrc/server/weapons/common.qc
@@ -2,6 +2,7 @@
 
 #include <common/t_items.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/deathtypes/all.qh>
 #include <common/notifications/all.qh>
 #include <common/util.qh>
diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc
index a8a893e217..9fcfd34c20 100644
--- a/qcsrc/server/weapons/csqcprojectile.qc
+++ b/qcsrc/server/weapons/csqcprojectile.qc
@@ -5,6 +5,7 @@
 #include "../command/common.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/weapons/_all.qh>
 
 .float csqcprojectile_type;
diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc
index 56df6c3a2c..539371a53c 100644
--- a/qcsrc/server/weapons/selection.qc
+++ b/qcsrc/server/weapons/selection.qc
@@ -3,6 +3,7 @@
 #include "weaponsystem.qh"
 #include <common/t_items.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/util.qh>
 #include <common/items/item.qh>
 #include <common/weapons/_all.qh>
diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc
index 3b7aa7bf89..b49ed88f59 100644
--- a/qcsrc/server/weapons/tracing.qc
+++ b/qcsrc/server/weapons/tracing.qc
@@ -10,6 +10,7 @@
 #include "../antilag.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/util.qh>
 
 #include <common/weapons/_all.qh>
diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc
index 4968d3c31f..c0d302e223 100644
--- a/qcsrc/server/weapons/weaponsystem.qc
+++ b/qcsrc/server/weapons/weaponsystem.qc
@@ -8,6 +8,7 @@
 #include <common/t_items.qh>
 #include <common/animdecide.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
 #include <common/util.qh>
-- 
2.39.5