]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't spawn by default some useless entities of game modes and mutators
authorterencehill <piuntn@gmail.com>
Sun, 28 Jul 2019 22:16:29 +0000 (00:16 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 29 Jul 2019 11:58:34 +0000 (13:58 +0200)
15 files changed:
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh
qcsrc/common/gamemodes/gamemode/domination/sv_domination.qh
qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qc
qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qh
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qh
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qh
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qh
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qc
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qh

index 835073d07d7e655f896f635de6ff560bdff34e35..a9de7fbc765139dd0a13379dc2679e4297030421 100644 (file)
@@ -3,16 +3,6 @@
 .entity sprite;
 #define AS_ROUND_DELAY 5
 
-IntrusiveList g_assault_destructibles;
-IntrusiveList g_assault_objectivedecreasers;
-IntrusiveList g_assault_objectives;
-STATIC_INIT(g_assault)
-{
-       g_assault_destructibles = IL_NEW();
-       g_assault_objectivedecreasers = IL_NEW();
-       g_assault_objectives = IL_NEW();
-}
-
 // random functions
 void assault_objective_use(entity this, entity actor, entity trigger)
 {
index fcfc78917f8239f64f2d72c3eee62ee5ed8511a3..3709bdff9386541b042fd1693249e59b521e3ca6 100644 (file)
@@ -7,11 +7,18 @@ const int ASSAULT_VALUE_INACTIVE = 1000;
 
 const int ST_ASSAULT_OBJECTIVES = 1;
 
+IntrusiveList g_assault_destructibles;
+IntrusiveList g_assault_objectivedecreasers;
+IntrusiveList g_assault_objectives;
+
 REGISTER_MUTATOR(as, false)
 {
     MUTATOR_STATIC();
        MUTATOR_ONADD
        {
+               g_assault_destructibles = IL_NEW();
+               g_assault_objectivedecreasers = IL_NEW();
+               g_assault_objectives = IL_NEW();
         GameRules_teams(true);
         int teams = BITS(2); // always red vs blue
         GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
index b1518bd4fc1825df24868ce50597f31cb1368d4c..492da41b14034ca00be29f55efdd6c9fda75f6b0 100644 (file)
@@ -2,6 +2,11 @@
 
 #include "ctf.qh"
 
+CLASS(Flag, Pickup)
+    ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
+    ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
+ENDCLASS(Flag)
+Flag CTF_FLAG;
 void ctf_Initialize();
 
 REGISTER_MUTATOR(ctf, false)
@@ -9,6 +14,7 @@ REGISTER_MUTATOR(ctf, false)
     MUTATOR_STATIC();
     MUTATOR_ONADD
     {
+               CTF_FLAG = NEW(Flag);
         GameRules_teams(true);
         GameRules_limit_score(autocvar_capturelimit_override);
         GameRules_limit_lead(autocvar_captureleadlimit_override);
@@ -24,12 +30,6 @@ void ctf_RespawnFlag(entity flag);
 // score rule declarations
 const int ST_CTF_CAPS = 1;
 
-CLASS(Flag, Pickup)
-    ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
-    ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
-ENDCLASS(Flag)
-Flag CTF_FLAG;
-STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
 void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }
 
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
index 67e00082c3d9c4f530819de9bce682ab83b810d1..e937a958edfc6d657fc1e0bf68aa06ec80ba730c 100644 (file)
@@ -6,6 +6,7 @@ bool autocvar_g_domination_roundbased;
 int autocvar_g_domination_roundbased_point_limit;
 int autocvar_g_domination_point_leadlimit;
 
+IntrusiveList g_dompoints;
 void dom_Initialize();
 
 REGISTER_MUTATOR(dom, false)
@@ -13,6 +14,8 @@ REGISTER_MUTATOR(dom, false)
     MUTATOR_STATIC();
        MUTATOR_ONADD
        {
+               g_dompoints = IL_NEW();
+
                int fraglimit_override = autocvar_g_domination_point_limit;
                if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
                        fraglimit_override = autocvar_g_domination_roundbased_point_limit;
@@ -47,6 +50,3 @@ float domination_roundbased;
 float domination_teams;
 
 void AnimateDomPoint(entity this);
-
-IntrusiveList g_dompoints;
-STATIC_INIT(g_dompoints) { g_dompoints = IL_NEW(); }
index 31c5711424834925e91cb53e21d64da6ea2e9e39..bb1c9aee948fe2fcd01d838a47889e5bb3103dc3 100644 (file)
@@ -6,16 +6,6 @@
 
 #include <server/teamplay.qh>
 
-IntrusiveList g_invasion_roundends;
-IntrusiveList g_invasion_waves;
-IntrusiveList g_invasion_spawns;
-STATIC_INIT(g_invasion)
-{
-       g_invasion_roundends = IL_NEW();
-       g_invasion_waves = IL_NEW();
-       g_invasion_spawns = IL_NEW();
-}
-
 float autocvar_g_invasion_round_timelimit;
 float autocvar_g_invasion_spawnpoint_spawn_delay;
 float autocvar_g_invasion_warmup;
index 167380eeb2a73a947c38ffbf3267b2d984d66f62..3c16e34e18dea1b1179760cadb65aea08c3a0ce9 100644 (file)
@@ -6,6 +6,9 @@ int autocvar_g_invasion_teams;
 int autocvar_g_invasion_type;
 bool autocvar_g_invasion_team_spawns;
 bool g_invasion;
+IntrusiveList g_invasion_roundends;
+IntrusiveList g_invasion_waves;
+IntrusiveList g_invasion_spawns;
 void invasion_Initialize();
 
 REGISTER_MUTATOR(inv, false)
@@ -13,6 +16,9 @@ REGISTER_MUTATOR(inv, false)
     MUTATOR_STATIC();
        MUTATOR_ONADD
        {
+               g_invasion_roundends = IL_NEW();
+               g_invasion_waves = IL_NEW();
+               g_invasion_spawns = IL_NEW();
                if (autocvar_g_invasion_teams >= 2) {
                        GameRules_teams(true);
                        GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
index add678d7b3f513389689f3c59f3a5c56005156fe..4ee4534001ddba51d1f1524f49b614d294c8b912 100644 (file)
@@ -5,11 +5,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_GENERATOR)
 REGISTER_NET_LINKED(ENT_CLIENT_CONTROLPOINT_ICON)
 #endif
 
-#ifdef SVQC
-IntrusiveList g_onsshields;
-STATIC_INIT(g_onsshields) { g_onsshields = IL_NEW(); }
-#endif
-
 #ifdef CSQC
 IntrusiveList g_onsgenerators;
 STATIC_INIT(g_onsgenerators) { g_onsgenerators = IL_NEW(); }
index 7a9b192a5a7b041e313c807dd464b04d3e0c3e98..52eec4abcc7a93ac6c133d0b08478f1aca145c86 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 float autocvar_g_onslaught_point_limit;
+IntrusiveList g_onsshields;
 void ons_Initialize();
 
 REGISTER_MUTATOR(ons, false)
@@ -8,6 +9,7 @@ REGISTER_MUTATOR(ons, false)
     MUTATOR_STATIC();
        MUTATOR_ONADD
        {
+               g_onsshields = IL_NEW();
                GameRules_teams(true);
                GameRules_limit_score(autocvar_g_onslaught_point_limit);
 
index 63f3182ea6ba4746abb57d5491c5c97d29294adc..a9eac2423240f561e93494bb459d07c6a1939479 100644 (file)
@@ -17,16 +17,6 @@ bool autocvar_g_instagib_ammo_convert_bullets;
 int autocvar_g_instagib_extralives;
 float autocvar_g_instagib_speed_highspeed;
 
-IntrusiveList g_instagib_items;
-STATIC_INIT(instagib)
-{
-       g_instagib_items = IL_NEW();
-       IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
-       IL_PUSH(g_instagib_items, ITEM_ExtraLife);
-       IL_PUSH(g_instagib_items, ITEM_Invisibility);
-       IL_PUSH(g_instagib_items, ITEM_Speed);
-}
-
 void instagib_invisibility(entity this)
 {
        this.strength_finished = autocvar_g_instagib_invisibility_time;
index 56f4ac7daaaace7d5d831d281107ed0632d75eaf..d01abd080e05be7726407aa0bd11cd16c81463fc 100644 (file)
@@ -7,11 +7,18 @@ float autocvar_g_instagib_invis_alpha;
 void instagib_invisibility(entity this);
 void instagib_extralife(entity this);
 void instagib_speed(entity this);
+IntrusiveList g_instagib_items;
 
 REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball)
 {
        MUTATOR_ONADD
        {
+               g_instagib_items = IL_NEW();
+               IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
+               IL_PUSH(g_instagib_items, ITEM_ExtraLife);
+               IL_PUSH(g_instagib_items, ITEM_Invisibility);
+               IL_PUSH(g_instagib_items, ITEM_Speed);
+
                ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
                ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
                ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
index c6a853d0e11bf02ac8a7ee8c540870d88097d2e4..6418f2a01a6e6b671a6eeed025758021dc185434 100644 (file)
@@ -159,8 +159,6 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 #include <common/monsters/sv_spawn.qh>
 #include <common/monsters/sv_monsters.qh>
 
-REGISTER_MUTATOR(nades, autocvar_g_nades);
-
 .float nade_time_primed;
 .float nade_lifetime;
 
@@ -1251,7 +1249,14 @@ CLASS(NadeOffhand, OffhandWeapon)
     }
 ENDCLASS(NadeOffhand)
 NadeOffhand OFFHAND_NADE;
-STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
+REGISTER_MUTATOR(nades, autocvar_g_nades)
+{
+       MUTATOR_ONADD
+       {
+               OFFHAND_NADE = NEW(NadeOffhand);
+       }
+       return 0;
+}
 
 MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
 {
index 41ba2da62b0ada5c48b9d9c1baa1dcdcb7074d2a..993afcdd4d5c2ae60ed5108004f3a950054f306c 100644 (file)
@@ -10,17 +10,6 @@ bool autocvar_g_overkill_itemwaypoints = true;
 
 .Weapon ok_lastwep[MAX_WEAPONSLOTS];
 
-IntrusiveList g_overkill_items;
-STATIC_INIT(overkill)
-{
-       g_overkill_items = IL_NEW();
-       IL_PUSH(g_overkill_items, ITEM_HealthMega);
-       IL_PUSH(g_overkill_items, ITEM_ArmorSmall);
-       IL_PUSH(g_overkill_items, ITEM_ArmorMedium);
-       IL_PUSH(g_overkill_items, ITEM_ArmorBig);
-       IL_PUSH(g_overkill_items, ITEM_ArmorMega);
-}
-
 /// \brief Returns a random classname of the overkill item.
 /// \param[in] prefix Prefix of the cvars that hold probabilities.
 /// \return Random classname of the overkill item.
index 79e5dd3c5b0cbce85cee0d53108046f8a14bf3fa..9ee809df65197d123a24d74edb8d090d7ab67ccf 100644 (file)
@@ -7,6 +7,7 @@ bool autocvar_g_overkill_filter_armorbig;
 bool autocvar_g_overkill_filter_armormega;
 
 .float ok_item;
+IntrusiveList g_overkill_items;
 
 REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(mutator_instagib) && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
 {
@@ -30,6 +31,12 @@ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(m
                {
                        ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
                }
+               g_overkill_items = IL_NEW();
+               IL_PUSH(g_overkill_items, ITEM_HealthMega);
+               IL_PUSH(g_overkill_items, ITEM_ArmorSmall);
+               IL_PUSH(g_overkill_items, ITEM_ArmorMedium);
+               IL_PUSH(g_overkill_items, ITEM_ArmorBig);
+               IL_PUSH(g_overkill_items, ITEM_ArmorMega);
        }
 
        MUTATOR_ONREMOVE
index 9458189fd0ed20a448b9da906b3f654c12632452..35f58e89a6f178e095d52bdf09fe40a5f4667d5a 100644 (file)
@@ -16,6 +16,7 @@ float autocvar_g_sandbox_object_scale_max;
 float autocvar_g_sandbox_object_material_velocity_min;
 float autocvar_g_sandbox_object_material_velocity_factor;
 
+IntrusiveList g_sandbox_objects;
 float autosave_time;
 void sandbox_Database_Load();
 
@@ -23,6 +24,7 @@ REGISTER_MUTATOR(sandbox, expr_evaluate(autocvar_g_sandbox))
 {
        MUTATOR_ONADD
        {
+               g_sandbox_objects = IL_NEW();
                autosave_time = time + autocvar_g_sandbox_storage_autosave; // don't save the first server frame
                if(autocvar_g_sandbox_storage_autoload)
                        sandbox_Database_Load();
index f6a0afdf404c1fdb173299f20d86dee76a25e65c..6f70f09beec2219624baeca92e2cd7deaa104fb4 100644 (file)
@@ -1,4 +1 @@
 #pragma once
-
-IntrusiveList g_sandbox_objects;
-STATIC_INIT(g_sandbox_objects) { g_sandbox_objects = IL_NEW(); }