]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option (disabled by default) to spawn powerups in duel
authorMario <mario@smbclan.net>
Mon, 1 Oct 2018 05:29:56 +0000 (15:29 +1000)
committerMario <mario@smbclan.net>
Mon, 1 Oct 2018 05:29:56 +0000 (15:29 +1000)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc
qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh

index 7cc47c3639858e77f0aea47961a61ecd86bd5378..7b2203c39056607559805bd81c9cd0a4c793d188 100644 (file)
@@ -539,3 +539,4 @@ set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: co
 //  duel
 // ======
 set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
+set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode"
index 7e4c891e6440da0a58553045438f9a27eaca35f1..0f771411aaee48c5a72ad7a5747750a7ef77e7a2 100644 (file)
@@ -16,3 +16,15 @@ MUTATOR_HOOKFUNCTION(duel, Scores_CountFragsRemaining)
        // announce remaining frags?
        return true;
 }
+
+MUTATOR_HOOKFUNCTION(duel, FilterItemDefinition)
+{
+       entity definition = M_ARGV(0, entity);
+
+       if(definition.instanceOfPowerup)
+       {
+               return !autocvar_g_duel_with_powerups;
+       }
+
+       return false;
+}
index 9a0d716b920a1aa660c150ef7ae0fc5946036b54..d255c9b3532ebcd37db5c849abd668979a0bd7aa 100644 (file)
@@ -6,3 +6,5 @@ REGISTER_MUTATOR(duel, false)
     MUTATOR_STATIC();
        return 0;
 }
+
+bool autocvar_g_duel_with_powerups;