From: Mario Date: Mon, 1 Oct 2018 05:29:56 +0000 (+1000) Subject: Add an option (disabled by default) to spawn powerups in duel X-Git-Tag: xonotic-v0.8.5~1802 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ec0fae66f230a5e4a003fe4defc72d75aaca270;p=xonotic%2Fxonotic-data.pk3dir.git Add an option (disabled by default) to spawn powerups in duel --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 7cc47c363..7b2203c39 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -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" diff --git a/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc b/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc index 7e4c891e6..0f771411a 100644 --- a/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc +++ b/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qc @@ -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; +} diff --git a/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh b/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh index 9a0d716b9..d255c9b35 100644 --- a/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh +++ b/qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh @@ -6,3 +6,5 @@ REGISTER_MUTATOR(duel, false) MUTATOR_STATIC(); return 0; } + +bool autocvar_g_duel_with_powerups;