]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Survival: Better warmup weapons.
authorLyberta <lyberta@lyberta.net>
Tue, 11 Apr 2017 01:57:04 +0000 (04:57 +0300)
committerLyberta <lyberta@lyberta.net>
Tue, 11 Apr 2017 01:57:04 +0000 (04:57 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc

index fddb598fa0fd906947fb9d8b0e36818196bbe07e..ab60f01b98f5bfe2a32465f2539a5f897477917c 100644 (file)
@@ -1084,6 +1084,23 @@ void Surv_GiveStartWeapons(entity player)
                return;
        }
        int numweapons = tokenize_console(cvar_string(randomweaponlist));
+       if (warmup_stage)
+       {
+               // Give all weapons during warmup stage.
+               for (int i = 0; i < numweapons; ++i)
+               {
+                       string weapon = argv(i);
+                       FOREACH(Weapons, it != WEP_Null,
+                       {
+                               if (it.netname == weapon)
+                               {
+                                       player.weapons |= it.m_wepset;
+                                       break;
+                               }
+                       });
+               }
+               return;
+       }
        for (int i = 0; i < numrandomweapons; ++i)
        {
                // Finding weapon which player doesn't have.
@@ -1372,6 +1389,7 @@ MUTATOR_HOOKFUNCTION(surv, SetWeaponArena)
 MUTATOR_HOOKFUNCTION(surv, SetStartItems)
 {
        start_weapons = WEPSET(Null);
+       warmup_start_weapons = WEPSET(Null);
 }
 
 MUTATOR_HOOKFUNCTION(surv, SV_StartFrame)