From 974baf3eb21dc14b7cdb7cdb98987494e0575fd1 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 15 Aug 2015 11:59:54 +1000 Subject: [PATCH] Make clean gamecode expansion possible --- mod/client/main.qc | 0 mod/client/progs.inc | 3 +++ mod/server/main.qc | 24 ++++++++++++++++++++++++ mod/server/progs.inc | 3 +++ qcsrc/Makefile | 3 ++- qcsrc/client/progs.src | 2 ++ qcsrc/server/progs.src | 2 ++ 7 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mod/client/main.qc create mode 100644 mod/client/progs.inc create mode 100644 mod/server/main.qc create mode 100644 mod/server/progs.inc diff --git a/mod/client/main.qc b/mod/client/main.qc new file mode 100644 index 000000000..e69de29bb diff --git a/mod/client/progs.inc b/mod/client/progs.inc new file mode 100644 index 000000000..ae91a9e1c --- /dev/null +++ b/mod/client/progs.inc @@ -0,0 +1,3 @@ +#if BUILD_MOD +#include "main.qc" +#endif diff --git a/mod/server/main.qc b/mod/server/main.qc new file mode 100644 index 000000000..1342b7b4a --- /dev/null +++ b/mod/server/main.qc @@ -0,0 +1,24 @@ +MUTATOR_HOOKFUNCTION(mod_BuildMutatorsString) +{ + ret_string = strcat(ret_string, ":mod"); + return false; +} + +MUTATOR_HOOKFUNCTION(mod_BuildMutatorsPrettyString) +{ + ret_string = strcat(ret_string, ", Mod"); + return false; +} + +MUTATOR_DEFINITION(mutator_mod) +{ + MUTATOR_HOOK(BuildMutatorsString, mod_BuildMutatorsString, CBC_ORDER_ANY); + MUTATOR_HOOK(BuildMutatorsPrettyString, mod_BuildMutatorsPrettyString, CBC_ORDER_ANY); + return false; +} + +[[accumulate]] +void mutators_add() +{ + MUTATOR_ADD(mutator_mod); +} diff --git a/mod/server/progs.inc b/mod/server/progs.inc new file mode 100644 index 000000000..ae91a9e1c --- /dev/null +++ b/mod/server/progs.inc @@ -0,0 +1,3 @@ +#if BUILD_MOD +#include "main.qc" +#endif diff --git a/qcsrc/Makefile b/qcsrc/Makefile index f53707e82..0ccf4f971 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -20,7 +20,8 @@ QCCFLAGS ?= \ QCCFLAGS_FEATURES ?= \ -DVEHICLES_ENABLED=1 \ - -DVEHICLES_USE_ODE=0 + -DVEHICLES_USE_ODE=0 \ + -DBUILD_MOD=$(BUILD_MOD) # xonotic build system overrides this by command line argument to turn off the update-cvarcount step XON_BUILDSYSTEM = diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index d161c6dfc..f5408fb85 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -77,3 +77,5 @@ weapons/projectile.qc // TODO ../warpzonelib/common.qc ../warpzonelib/mathlib.qc ../warpzonelib/util_server.qc + +../../mod/client/progs.inc diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 388d1b675..1f045bcb2 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -116,3 +116,5 @@ weapons/weaponsystem.qc ../warpzonelib/mathlib.qc ../warpzonelib/server.qc ../warpzonelib/util_server.qc + +../../mod/server/progs.inc -- 2.39.2