Merge branch 'master' into Mario/mutators2
authorMario <mario.mario@y7mail.com>
Wed, 4 Jun 2014 21:29:11 +0000 (07:29 +1000)
committerMario <mario.mario@y7mail.com>
Wed, 4 Jun 2014 21:29:11 +0000 (07:29 +1000)
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qc
qcsrc/server/mutators/mutators.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators_include.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators_include.qh [new file with mode: 0644]
qcsrc/server/progs.src

index 5dc6f2e..f666a68 100644 (file)
@@ -904,34 +904,11 @@ float sv_autotaunt;
 float sv_taunt;
 
 string GetGametype(); // g_world.qc
+void mutators_add(); // mutators.qc
 void readlevelcvars(void)
 {
        // load mutators
-       #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
-               { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
-
-       CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
-       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
-       CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
-       CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
-       CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, 1);
-       CHECK_MUTATOR_ADD("g_invincible_projectiles", mutator_invincibleprojectiles, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_new_toys", mutator_new_toys, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_nix", mutator_nix, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
-       CHECK_MUTATOR_ADD("g_pinata", mutator_pinata, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_midair", mutator_midair, 1);
-       CHECK_MUTATOR_ADD("g_bloodloss", mutator_bloodloss, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_random_gravity", mutator_random_gravity, 1);
-       CHECK_MUTATOR_ADD("g_multijump", mutator_multijump, 1);
-       CHECK_MUTATOR_ADD("g_melee_only", mutator_melee_only, !cvar("g_minstagib"));
-       CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
-       CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
-       CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
-
-       #undef CHECK_MUTATOR_ADD
+       mutators_add();
 
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
index d2cec39..1ba8f26 100644 (file)
@@ -91,7 +91,7 @@ float CallbackChain_Call(entity cb)
        return r; // callbacks return an error status, so 0 is default return value
 }
 
-#define MAX_MUTATORS 8
+#define MAX_MUTATORS 15
 string loaded_mutators[MAX_MUTATORS];
 float Mutator_Add(mutatorfunc_t func, string name)
 {
diff --git a/qcsrc/server/mutators/mutators.qc b/qcsrc/server/mutators/mutators.qc
new file mode 100644 (file)
index 0000000..e2331de
--- /dev/null
@@ -0,0 +1,28 @@
+void mutators_add()
+{
+       #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
+               { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
+
+       CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
+       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
+       CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
+       CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
+       CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, !g_nexball);
+       CHECK_MUTATOR_ADD("g_invincible_projectiles", mutator_invincibleprojectiles, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_new_toys", mutator_new_toys, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_nix", mutator_nix, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
+       CHECK_MUTATOR_ADD("g_pinata", mutator_pinata, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_midair", mutator_midair, 1);
+       CHECK_MUTATOR_ADD("g_bloodloss", mutator_bloodloss, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_random_gravity", mutator_random_gravity, 1);
+       CHECK_MUTATOR_ADD("g_multijump", mutator_multijump, 1);
+       CHECK_MUTATOR_ADD("g_melee_only", mutator_melee_only, !cvar("g_minstagib") && !g_nexball);
+       CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
+       CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
+       CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
+
+       #undef CHECK_MUTATOR_ADD
+}
diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc
new file mode 100644 (file)
index 0000000..39faeb4
--- /dev/null
@@ -0,0 +1,33 @@
+#include "base.qc"
+#include "gamemode_assault.qc"
+#include "gamemode_ca.qc"
+#include "gamemode_ctf.qc"
+#include "gamemode_domination.qc"
+#include "gamemode_freezetag.qc"
+#include "gamemode_keyhunt.qc"
+#include "gamemode_keepaway.qc"
+#include "gamemode_nexball.qc"
+#include "gamemode_onslaught.qc"
+#include "gamemode_lms.qc"
+#include "gamemode_invasion.qc"
+
+#include "mutator_invincibleproj.qc"
+#include "mutator_new_toys.qc"
+#include "mutator_nix.qc"
+#include "mutator_dodging.qc"
+#include "mutator_rocketflying.qc"
+#include "mutator_vampire.qc"
+#include "mutator_spawn_near_teammate.qc"
+#include "mutator_physical_items.qc"
+#include "sandbox.qc"
+#include "mutator_superspec.qc"
+#include "mutator_minstagib.qc"
+#include "mutator_touchexplode.qc"
+#include "mutator_pinata.qc"
+#include "mutator_midair.qc"
+#include "mutator_bloodloss.qc"
+#include "mutator_random_gravity.qc"
+#include "mutator_multijump.qc"
+#include "mutator_melee_only.qc"
+#include "mutator_nades.qc"
+#include "mutator_campcheck.qc"
diff --git a/qcsrc/server/mutators/mutators_include.qh b/qcsrc/server/mutators/mutators_include.qh
new file mode 100644 (file)
index 0000000..60c522c
--- /dev/null
@@ -0,0 +1,14 @@
+#include "base.qh"
+#include "mutators.qh"
+#include "gamemode_assault.qh"
+#include "gamemode_ca.qh"
+#include "gamemode_ctf.qh"
+#include "gamemode_domination.qh"
+#include "gamemode_keyhunt.qh"
+#include "gamemode_keepaway.qh"
+#include "gamemode_nexball.qh"
+#include "gamemode_lms.qh"
+#include "gamemode_invasion.qh"
+
+#include "mutator_dodging.qh"
+#include "mutator_nades.qh"
index 1ae22e2..25b9d6d 100644 (file)
@@ -37,19 +37,7 @@ defs.qh              // Should rename this, it has fields and globals
 ../common/notifications.qh // must be after autocvars
 ../common/deathtypes.qh // must be after notifications
 
-mutators/base.qh
-mutators/mutators.qh
-mutators/gamemode_assault.qh
-mutators/gamemode_ca.qh
-mutators/gamemode_ctf.qh
-mutators/gamemode_domination.qh
-mutators/gamemode_keyhunt.qh // TODO fix this
-mutators/gamemode_keepaway.qh
-mutators/gamemode_nexball.qh 
-mutators/gamemode_lms.qh
-mutators/gamemode_invasion.qh
-mutators/mutator_dodging.qh
-mutators/mutator_nades.qh
+mutators/mutators_include.qh
 
 //// tZork Turrets ////
 tturrets/include/turrets_early.qh
@@ -106,6 +94,8 @@ scores_rules.qc
 
 miscfunctions.qc
 
+mutators/mutators.qc
+
 waypointsprites.qc
 
 bot/bot.qc
@@ -234,38 +224,7 @@ round_handler.qc
 
 ../common/monsters/spawn.qc
 
-mutators/base.qc
-mutators/gamemode_assault.qc
-mutators/gamemode_ca.qc
-mutators/gamemode_ctf.qc
-mutators/gamemode_domination.qc
-mutators/gamemode_freezetag.qc
-mutators/gamemode_keyhunt.qc
-mutators/gamemode_keepaway.qc
-mutators/gamemode_nexball.qc
-mutators/gamemode_onslaught.qc
-mutators/gamemode_lms.qc
-mutators/gamemode_invasion.qc
-mutators/mutator_invincibleproj.qc
-mutators/mutator_new_toys.qc
-mutators/mutator_nix.qc
-mutators/mutator_dodging.qc
-mutators/mutator_rocketflying.qc
-mutators/mutator_vampire.qc
-mutators/mutator_spawn_near_teammate.qc
-mutators/mutator_physical_items.qc
-mutators/sandbox.qc
-mutators/mutator_superspec.qc
-mutators/mutator_minstagib.qc
-mutators/mutator_touchexplode.qc
-mutators/mutator_pinata.qc
-mutators/mutator_midair.qc
-mutators/mutator_bloodloss.qc
-mutators/mutator_random_gravity.qc
-mutators/mutator_multijump.qc
-mutators/mutator_melee_only.qc
-mutators/mutator_nades.qc
-mutators/mutator_campcheck.qc
+mutators/mutators_include.qc
 
 ../warpzonelib/anglestransform.qc
 ../warpzonelib/mathlib.qc